浏览代码

NFC: port100: Fix device leak

port100_probe() calls usb_get_dev(), but there is no usb_put_dev()
in port100_disconnect(). The patch adds one.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Alexey Khoroshilov 11 年之前
父节点
当前提交
c36aeba8c0
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      drivers/nfc/port100.c

+ 1 - 0
drivers/nfc/port100.c

@@ -1509,6 +1509,7 @@ static void port100_disconnect(struct usb_interface *interface)
 
 
 	usb_free_urb(dev->in_urb);
 	usb_free_urb(dev->in_urb);
 	usb_free_urb(dev->out_urb);
 	usb_free_urb(dev->out_urb);
+	usb_put_dev(dev->udev);
 
 
 	kfree(dev->cmd);
 	kfree(dev->cmd);