[media] usbtv: fix leak at failure path in usbtv_probe()
authorAlexey Khoroshilov <khoroshilov@ispras.ru>
Fri, 23 May 2014 20:47:07 +0000 (17:47 -0300)
committerMauro Carvalho Chehab <m.chehab@samsung.com>
Tue, 17 Jun 2014 15:04:46 +0000 (12:04 -0300)
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>
drivers/media/usb/usbtv/usbtv-core.c

index 2f87ddfa469f00d1a249bdb77e9745265ce49fb9..473fab81b602276b85cc2320eb76854611fe16ee 100644 (file)
@@ -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;