From: Harvey Yang <harvey.huawei.yang@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Matt Mooney <mfm@muteddisk.com>
Cc: linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org,
"harvey.yang" <harvey.huawei.yang@gmail.com>
Subject: [PATCH 1/1] staging: usbip: put usb_device and kill event handler thread in error cleanups.
Date: Tue, 6 Nov 2012 16:10:29 +0800 [thread overview]
Message-ID: <1352189429-3024-1-git-send-email-harvey.huawei.yang@gmail.com> (raw)
From: harvey.yang <harvey.huawei.yang@gmail.com>
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>
---
drivers/staging/usbip/stub_dev.c | 2 ++
1 files changed, 2 insertions(+), 0 deletions(-)
diff --git a/drivers/staging/usbip/stub_dev.c b/drivers/staging/usbip/stub_dev.c
index c8d79a7..16a6868 100644
--- a/drivers/staging/usbip/stub_dev.c
+++ b/drivers/staging/usbip/stub_dev.c
@@ -432,6 +432,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;
--
1.7.1
reply other threads:[~2012-11-06 8:06 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1352189429-3024-1-git-send-email-harvey.huawei.yang@gmail.com \
--to=harvey.huawei.yang@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=mfm@muteddisk.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®