diff options
author | Alexey Khoroshilov <khoroshilov@ispras.ru> | 2013-12-20 20:17:32 +0100 |
---|---|---|
committer | Mauro Carvalho Chehab <m.chehab@samsung.com> | 2014-02-04 09:28:00 +0100 |
commit | 50c88544d225baadd6de1c4365d4ed16cc942a37 (patch) | |
tree | cb3b749bb728488e50add71004bce48bc8b71df8 /drivers | |
parent | [media] media: bt8xx: add missing put_device call (diff) | |
download | linux-50c88544d225baadd6de1c4365d4ed16cc942a37.tar.xz linux-50c88544d225baadd6de1c4365d4ed16cc942a37.zip |
[media] go7007-loader: fix usb_dev leak
There is usb_get_dev() in go7007_loader_probe(),
but there is no usb_put_dev() anywhere.
Found by Linux Driver Verification project (linuxtesting.org).
Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/media/go7007/go7007-loader.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/staging/media/go7007/go7007-loader.c b/drivers/staging/media/go7007/go7007-loader.c index 10bb41c2fb6d..eecb1f2a5574 100644 --- a/drivers/staging/media/go7007/go7007-loader.c +++ b/drivers/staging/media/go7007/go7007-loader.c @@ -59,7 +59,7 @@ static int go7007_loader_probe(struct usb_interface *interface, if (usbdev->descriptor.bNumConfigurations != 1) { dev_err(&interface->dev, "can't handle multiple config\n"); - return -ENODEV; + goto failed2; } vendor = le16_to_cpu(usbdev->descriptor.idVendor); @@ -108,6 +108,7 @@ static int go7007_loader_probe(struct usb_interface *interface, return 0; failed2: + usb_put_dev(usbdev); dev_err(&interface->dev, "probe failed\n"); return -ENODEV; } @@ -115,6 +116,7 @@ failed2: static void go7007_loader_disconnect(struct usb_interface *interface) { dev_info(&interface->dev, "disconnect\n"); + usb_put_dev(interface_to_usbdev(interface)); usb_set_intfdata(interface, NULL); } |