diff options
author | Alexey Khoroshilov <khoroshilov@ispras.ru> | 2014-02-05 19:47:13 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-02-07 12:19:30 -0500 |
commit | d3a874e899b073496d1fe89b6a2d1aa50870874d (patch) | |
tree | 12430d667d3d0ba12b8664e96e5c8a172faee85b | |
parent | ead00ddca0578aa9984e7e712024aead113e8253 (diff) |
staging: gdm72xx: fix leaks at failure path in gdm_usb_probe()
Error handling code in gdm_usb_probe() misses to deallocate
tx_ and rx_structs and to do usb_put_dev().
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>
-rw-r--r-- | drivers/staging/gdm72xx/gdm_usb.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/staging/gdm72xx/gdm_usb.c b/drivers/staging/gdm72xx/gdm_usb.c index f8788bf0a7d3..cdeffe75496b 100644 --- a/drivers/staging/gdm72xx/gdm_usb.c +++ b/drivers/staging/gdm72xx/gdm_usb.c | |||
@@ -635,11 +635,14 @@ static int gdm_usb_probe(struct usb_interface *intf, | |||
635 | #endif /* CONFIG_WIMAX_GDM72XX_USB_PM */ | 635 | #endif /* CONFIG_WIMAX_GDM72XX_USB_PM */ |
636 | 636 | ||
637 | ret = register_wimax_device(phy_dev, &intf->dev); | 637 | ret = register_wimax_device(phy_dev, &intf->dev); |
638 | if (ret) | ||
639 | release_usb(udev); | ||
638 | 640 | ||
639 | out: | 641 | out: |
640 | if (ret) { | 642 | if (ret) { |
641 | kfree(phy_dev); | 643 | kfree(phy_dev); |
642 | kfree(udev); | 644 | kfree(udev); |
645 | usb_put_dev(usbdev); | ||
643 | } else { | 646 | } else { |
644 | usb_set_intfdata(intf, phy_dev); | 647 | usb_set_intfdata(intf, phy_dev); |
645 | } | 648 | } |