staging: usbip: put usb_device and kill event handler thread in error cleanups.
authorHarvey Yang <harvey.huawei.yang@gmail.com>
Tue, 6 Nov 2012 08:10:29 +0000 (16:10 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 13 Nov 2012 21:08:48 +0000 (13:08 -0800)
If probe returns with error, the kthread is still alive even when all
usbip modules unloaded. So do cleanups in error handler.

Signed-off-by: harvey.yang <harvey.huawei.yang@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/usbip/stub_dev.c

index 79298d068636a7a9e4d19ff73994e41479b74687..ee36415eb26db02a543f9a5d75642b21bfe07712 100644 (file)
@@ -433,6 +433,8 @@ static int stub_probe(struct usb_interface *interface,
                dev_err(&interface->dev, "stub_add_files for %s\n", udev_busid);
                usb_set_intfdata(interface, NULL);
                usb_put_intf(interface);
+               usb_put_dev(udev);
+               kthread_stop_put(sdev->ud.eh);
 
                busid_priv->interf_count = 0;
                busid_priv->sdev = NULL;