浏览代码

[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>
Alexey Khoroshilov 11 年之前
父节点
当前提交
ebdae6507b
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      drivers/media/usb/usbtv/usbtv-core.c

+ 2 - 0
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;