From 695bcb1c0a50e8fe04f0ab868cac849130788bc0 Mon Sep 17 00:00:00 2001 From: Harvey Yang Date: Tue, 6 Nov 2012 16:10:29 +0800 Subject: [PATCH] staging: usbip: put usb_device and kill event handler thread in error cleanups. 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 Signed-off-by: Greg Kroah-Hartman --- drivers/staging/usbip/stub_dev.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/usbip/stub_dev.c b/drivers/staging/usbip/stub_dev.c index 79298d068636..ee36415eb26d 100644 --- a/drivers/staging/usbip/stub_dev.c +++ b/drivers/staging/usbip/stub_dev.c @@ -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; -- 2.20.1