diff options
author | Alexey Khoroshilov <khoroshilov@ispras.ru> | 2013-09-28 07:51:51 +0400 |
---|---|---|
committer | John W. Linville <linville@tuxdriver.com> | 2014-05-22 22:04:36 +0400 |
commit | 5c2b6078ce02c3e81eb0aa2f07bf59ba67461ce2 (patch) | |
tree | 2fc81027d6e94e874c0ab101380852c8aa4c75d0 /drivers/net/wireless/ath/carl9170 | |
parent | b88bb291b21f364c5441bdbf8195502bc75e6b47 (diff) | |
download | linux-5c2b6078ce02c3e81eb0aa2f07bf59ba67461ce2.tar.xz |
carl9170: fix leaks at failure path in carl9170_usb_probe()
carl9170_usb_probe() does not handle request_firmware_nowait() failure
that leads to several leaks in this case.
The patch adds all required deallocations.
Found by Linux Driver Verification project (linuxtesting.org).
Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/ath/carl9170')
-rw-r--r-- | drivers/net/wireless/ath/carl9170/usb.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/net/wireless/ath/carl9170/usb.c b/drivers/net/wireless/ath/carl9170/usb.c index ca115f33746f..f35c7f30f9a6 100644 --- a/drivers/net/wireless/ath/carl9170/usb.c +++ b/drivers/net/wireless/ath/carl9170/usb.c @@ -1076,8 +1076,14 @@ static int carl9170_usb_probe(struct usb_interface *intf, carl9170_set_state(ar, CARL9170_STOPPED); - return request_firmware_nowait(THIS_MODULE, 1, CARL9170FW_NAME, + err = request_firmware_nowait(THIS_MODULE, 1, CARL9170FW_NAME, &ar->udev->dev, GFP_KERNEL, ar, carl9170_usb_firmware_step2); + if (err) { + usb_put_dev(udev); + usb_put_dev(udev); + carl9170_free(ar); + } + return err; } static void carl9170_usb_disconnect(struct usb_interface *intf) |