staging: ft1000: fix memory leak on error path in ft1000_probe()
authorAlexey Khoroshilov <khoroshilov@ispras.ru>
Mon, 10 Jun 2013 19:29:16 +0000 (23:29 +0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 12 Jun 2013 00:13:37 +0000 (17:13 -0700)
commit773fe724ab7ca9c32e2411eb2d85ea455e82714e
tree56fa1074d719a118bdb04159525563db78b02dfb
parent5f43264c5320624f3b458c5794f37220c4fc2934
staging: ft1000: fix memory leak on error path in ft1000_probe()

ft1000dev->tx_urb and ft1000dev->rx_urb are not deallocated
if something goes wrong in ft1000_probe(). Also there is no
check for success of urb allocation. The patch fixes the both issues.

By the way, there is no sense in GFP_ATOMIC for urb allocation here,
so it is changed to GFP_KERNEL.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/ft1000/ft1000-usb/ft1000_usb.c