summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Khoroshilov <khoroshilov@ispras.ru>2014-05-23 17:47:07 -0300
committerMauro Carvalho Chehab <m.chehab@samsung.com>2014-05-30 12:35:42 -0300
commit1faf516f8822e611cc3d51f28c25b44c6b609f10 (patch)
treecd221ebe1392bb7683cdbf024fcf0bc4d2cc49a1
parent2d7e62f4101c6a5c0bf6c2727df3cbca17381393 (diff)
downloadlwn-1faf516f8822e611cc3d51f28c25b44c6b609f10.tar.gz
lwn-1faf516f8822e611cc3d51f28c25b44c6b609f10.zip
[media] usbtv: fix leak at failure path in usbtv_probe()
Error handling code in usbtv_probe() misses usb_put_dev(). Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru> Acked-by: Lubomir Rintel <lkundrak@v3.sk> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
-rw-r--r--drivers/media/usb/usbtv/usbtv-core.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/media/usb/usbtv/usbtv-core.c b/drivers/media/usb/usbtv/usbtv-core.c
index 2f87ddfa469f..473fab81b602 100644
--- a/drivers/media/usb/usbtv/usbtv-core.c
+++ b/drivers/media/usb/usbtv/usbtv-core.c
@@ -91,6 +91,8 @@ static int usbtv_probe(struct usb_interface *intf,
return 0;
usbtv_video_fail:
+ usb_set_intfdata(intf, NULL);
+ usb_put_dev(usbtv->udev);
kfree(usbtv);
return ret;