[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>
This commit is contained in:
Alexey Khoroshilov 2013-12-20 16:17:32 -03:00 коммит произвёл Mauro Carvalho Chehab
Родитель 38121b6ef3
Коммит 50c88544d2
1 изменённых файлов: 3 добавлений и 1 удалений

Просмотреть файл

@ -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);
}