mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: navin patidar <navinp@cdac.in>
To: gregkh@linuxfoundation.org, mfm@muteddisk.com
Cc: linux-usb@vger.kernel.org, devel@driverdev.osuosl.org,
	linux-kernel@vger.kernel.org, navin patidar <navinp@cdac.in>
Subject: [PATCH] staging: usbip: vhci_hcd: Fixed oops during removal of vhci_hcd
Date: Fri, 14 Sep 2012 15:21:37 +0530	[thread overview]
Message-ID: <1347616297-3339-1-git-send-email-navinp@cdac.in> (raw)

In response to "usbip detach -p [port_number]" user command,vhci_shoutdown_connection gets
executed which kills tcp_tx,tcp_rx kernel threads and then vhci_device_reset resets
all usb_device struct variables except kernel thread pointers.

so, at the time of vhci_hcd removal vhci_shoutdown_connection tries to kill kernel threads
which are already killed.

Signed-off-by: navin patidar <navinp@cdac.in>
---
 drivers/staging/usbip/vhci_hcd.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/staging/usbip/vhci_hcd.c b/drivers/staging/usbip/vhci_hcd.c
index 6076f42..b1f427c 100644
--- a/drivers/staging/usbip/vhci_hcd.c
+++ b/drivers/staging/usbip/vhci_hcd.c
@@ -858,6 +858,9 @@ static void vhci_device_reset(struct usbip_device *ud)
 	if (vdev->udev)
 		usb_put_dev(vdev->udev);
 	vdev->udev = NULL;
+	/* Reset kernel thread pointers */
+	ud->tcp_rx = NULL;
+	ud->tcp_tx = NULL;
 
 	ud->tcp_socket = NULL;
 	ud->status = VDEV_ST_NULL;
-- 
1.7.9.5


-------------------------------------------------------------------------------------------------------------------------------

This e-mail is for the sole use of the intended recipient(s) and may
contain confidential and privileged information. If you are not the
intended recipient, please contact the sender by reply e-mail and destroy
all copies and the original message. Any unauthorized review, use,
disclosure, dissemination, forwarding, printing or copying of this email
is strictly prohibited and appropriate legal action will be taken.
-------------------------------------------------------------------------------------------------------------------------------


             reply	other threads:[~2012-09-14 10:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-14  9:51 navin patidar [this message]
2012-09-18  4:46 navin patidar
2012-09-18  7:42 ` Dan Carpenter

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=1347616297-3339-1-git-send-email-navinp@cdac.in \
    --to=navinp@cdac.in \
    --cc=devel@driverdev.osuosl.org \
    --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®