Re: [PATCH] USB: URB: Return -EALREADY for urbs in flight

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 20 Apr 2011, Paul Stewart wrote:

> Disambiguate between invalid URBs (ones that seem impossible
> to submit because they are broken) and ones that should not be
> submitted because they are already in flight.
> 
> Signed-off-by: Paul Stewart <pstew@xxxxxxxxxxxx>
> ---
>  drivers/usb/core/urb.c |    5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/core/urb.c b/drivers/usb/core/urb.c
> index ae334b0..fd6bcdb 100644
> --- a/drivers/usb/core/urb.c
> +++ b/drivers/usb/core/urb.c
> @@ -305,8 +305,10 @@ int usb_submit_urb(struct urb *urb, gfp_t mem_flags)
>  	struct usb_host_endpoint	*ep;
>  	int				is_out;
>  
> -	if (!urb || urb->hcpriv || !urb->complete)
> +	if (!urb || !urb->complete)
>  		return -EINVAL;
> +	if (urb->hcpriv)
> +		return -EALREADY;
>  	dev = urb->dev;
>  	if ((!dev) || (dev->state < USB_STATE_UNAUTHENTICATED))
>  		return -ENODEV;

Is there a reason for this patch?  Does it solve any problems for you?

You mustn't change any of the USB stacks return codes without 
making the appropriate change to Documentation/usb/error-codes.txt.

Alan Stern

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


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux