Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 50c88544 authored by Alexey Khoroshilov's avatar Alexey Khoroshilov Committed by Mauro Carvalho Chehab
Browse files

[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: default avatarAlexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
parent 38121b6e
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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 @@ static int go7007_loader_probe(struct usb_interface *interface,
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);
}