diff options
author | Alexey Khoroshilov <khoroshilov@ispras.ru> | 2013-10-18 21:49:38 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-10-19 21:23:15 (GMT) |
commit | f2c28cfc26e53101c39d8052777ea9d465c718e0 (patch) | |
tree | 14e4c7d56804fb978b08e301c1c2b7e2e39ecd9e /drivers/usb/wusbcore/cbaf.c | |
parent | f7d4ffa923731463848a3e540b4984f6caa9422f (diff) | |
download | linux-fsl-qoriq-f2c28cfc26e53101c39d8052777ea9d465c718e0.tar.xz |
USB: wusbcore: fix usb_dev leaks
cbaf_probe() does cbaf->usb_dev = usb_get_dev(interface_to_usbdev(iface)),
but there is no usb_put_dev() anywhere in cbaf.
The patch adds usb_put_dev() to cbaf_disconnect() and to an error path in cbaf_probe().
Also it adds missed usb_put_intf(iface) to the error path.
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>
Diffstat (limited to 'drivers/usb/wusbcore/cbaf.c')
-rw-r--r-- | drivers/usb/wusbcore/cbaf.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/usb/wusbcore/cbaf.c b/drivers/usb/wusbcore/cbaf.c index 010f990..f06ed82 100644 --- a/drivers/usb/wusbcore/cbaf.c +++ b/drivers/usb/wusbcore/cbaf.c @@ -623,6 +623,8 @@ static int cbaf_probe(struct usb_interface *iface, error_create_group: error_check: + usb_put_intf(iface); + usb_put_dev(cbaf->usb_dev); kfree(cbaf->buffer); error_kmalloc_buffer: kfree(cbaf); @@ -637,6 +639,7 @@ static void cbaf_disconnect(struct usb_interface *iface) sysfs_remove_group(&dev->kobj, &cbaf_dev_attr_group); usb_set_intfdata(iface, NULL); usb_put_intf(iface); + usb_put_dev(cbaf->usb_dev); kfree(cbaf->buffer); /* paranoia: clean up crypto keys */ kzfree(cbaf); |