linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging: usbip: vhci_hcd: Fixed oops during removal of vhci_hcd
@ 2012-09-18  4:46 navin patidar
  2012-09-18  7:42 ` Dan Carpenter
  0 siblings, 1 reply; 3+ messages in thread
From: navin patidar @ 2012-09-18  4:46 UTC (permalink / raw)
  To: gregkh, mfm; +Cc: linux-usb, devel, linux-kernel, navin patidar

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 |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/staging/usbip/vhci_hcd.c b/drivers/staging/usbip/vhci_hcd.c
index 12a9a5f..eea8298 100644
--- a/drivers/staging/usbip/vhci_hcd.c
+++ b/drivers/staging/usbip/vhci_hcd.c
@@ -859,6 +859,8 @@ static void vhci_device_reset(struct usbip_device *ud)
 		usb_put_dev(vdev->udev);
 	vdev->udev = NULL;
 
+	ud->tcp_rx = NULL;
+	ud->tcp_tx = NULL;
 	ud->tcp_socket = NULL;
 	ud->status = VDEV_ST_NULL;
 
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] staging: usbip: vhci_hcd: Fixed oops during removal of vhci_hcd
  2012-09-18  4:46 [PATCH] staging: usbip: vhci_hcd: Fixed oops during removal of vhci_hcd navin patidar
@ 2012-09-18  7:42 ` Dan Carpenter
  0 siblings, 0 replies; 3+ messages in thread
From: Dan Carpenter @ 2012-09-18  7:42 UTC (permalink / raw)
  To: navin patidar; +Cc: gregkh, mfm, devel, linux-usb, linux-kernel

On Tue, Sep 18, 2012 at 10:16:56AM +0530, navin patidar wrote:
> 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.
> 

Obviously, the same question would apply here.  Why don't you do
this in the shutdown function?

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH] staging: usbip: vhci_hcd: Fixed oops during removal of vhci_hcd
@ 2012-09-14  9:51 navin patidar
  0 siblings, 0 replies; 3+ messages in thread
From: navin patidar @ 2012-09-14  9:51 UTC (permalink / raw)
  To: gregkh, mfm; +Cc: linux-usb, devel, linux-kernel, navin patidar

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.
-------------------------------------------------------------------------------------------------------------------------------


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-09-18  7:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-18  4:46 [PATCH] staging: usbip: vhci_hcd: Fixed oops during removal of vhci_hcd navin patidar
2012-09-18  7:42 ` Dan Carpenter
  -- strict thread matches above, loose matches on Subject: below --
2012-09-14  9:51 navin patidar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).