On Wed, Feb 10, 2016 at 10:45:03AM +0900, Nobuo Iwata wrote:
> stub_shutdown_connection() : drivers/usb/usbip/stub_dev.c
>      stub_device_cleanup_urbs() : drivers/usb/usbip/stub_main.c 
> requests to kill pending URBs and clears priv lists.
> 
> stub_complete() : drivers/usb/usbip/stub_tx.c might be called with URBs 
> to have been requested to kill.
> 
> To avoid kernel panic, this patch ignores killed URBs linked to cleared 
> priv lists.
> To know the killed URBs in stub_complete(), sdev->ud.tcp_socket which 
> cleared before stub_device_cleanup_urbs() is checked.
> 
> The critial condition will happen by unbind command before detach, 
> broken connection in connect command and disconnect command. 
> 
> Signed-off-by: Nobuo Iwata <nobuo.iw...@fujixerox.co.jp>
> ---
>  drivers/usb/usbip/stub_tx.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/usbip/stub_tx.c b/drivers/usb/usbip/stub_tx.c
> index dbcabc9..f19f321 100644
> --- a/drivers/usb/usbip/stub_tx.c
> +++ b/drivers/usb/usbip/stub_tx.c
> @@ -97,7 +97,9 @@ void stub_complete(struct urb *urb)
>  
>       /* link a urb to the queue of tx. */
>       spin_lock_irqsave(&sdev->priv_lock, flags);
> -     if (priv->unlinking) {
> +     if (sdev->ud.tcp_socket == NULL) {
> +             dev_info(&urb->dev->dev, "discard a urb for closed connection");
> +     } else if (priv->unlinking) {
>               stub_enqueue_ret_unlink(sdev, priv->seqnum, urb->status);
>               stub_free_priv_and_urb(priv);
>       } else {

Why this one tiny bugfix at the end of this series?  Is this something
that could be applied without the huge 1/3 patch here?  If so, please
send it on its own.  If not, then please fix it in the place where you
made this bug happen.

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to