[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <50531832.3050902@mvista.com>
Date: Fri, 14 Sep 2012 15:42:42 +0400
From: Sergei Shtylyov <sshtylyov@...sta.com>
To: navin patidar <navinp@...c.in>
CC: gregkh@...uxfoundation.org, mfm@...eddisk.com,
linux-usb@...r.kernel.org, devel@...verdev.osuosl.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] staging: usbip: stub_dev: Fixed oops during removal of
usbip_host
Hello.
On 14-09-2012 13:53, navin patidar wrote:
> stub_device_reset should set kernel thread pointers to NULL.
> so that at the time of usbip_host removal stub_shoutdown_connection
> doesn't try to kill kernel threads which are already killed.
> Signed-off-by: navin patidar <navinp@...c.in>
> ---
> drivers/staging/usbip/stub_dev.c | 14 +++++++++-----
> 1 file changed, 9 insertions(+), 5 deletions(-)
> diff --git a/drivers/staging/usbip/stub_dev.c b/drivers/staging/usbip/stub_dev.c
> index 92ced35..f584af8 100644
> --- a/drivers/staging/usbip/stub_dev.c
> +++ b/drivers/staging/usbip/stub_dev.c
> @@ -192,16 +192,13 @@ static void stub_shutdown_connection(struct usbip_device *ud)
> if (ud->tcp_tx)
> kthread_stop_put(ud->tcp_tx);
>
> - /*
> - * 2. close the socket
> + /* 2. close the socket
It's the preferred comment style -- why modify it?
> *
> * tcp_socket is freed after threads are killed so that usbip_xmit does
> * not touch NULL socket.
> */
> - if (ud->tcp_socket) {
> + if (ud->tcp_socket)
> sock_release(ud->tcp_socket);
> - ud->tcp_socket = NULL;
> - }
>
> /* 3. free used data */
> stub_device_cleanup_urbs(sdev);
> @@ -233,6 +230,13 @@ static void stub_device_reset(struct usbip_device *ud)
>
> dev_dbg(&udev->dev, "device reset");
>
> + /*reset tcp socket*/
Add spaces after /* and before */, please.
> + ud->tcp_socket = NULL;
> +
> + /*reset kernel thread pointers */
Here too.
WBR, Sergei
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists