ACK: [Xenial][PATCH 1/1] USB: cdc-wdm: ignore -EPIPE from GetEncapsulatedResponse

Connor Kuehl connor.kuehl at canonical.com
Wed Nov 6 22:37:49 UTC 2019


On 11/5/19 1:41 AM, Wen-chien Jesse Sung wrote:
> (backported from commit 8fec9355a968ad240f3a2e9ad55b823cf1cc52ff)
> Signed-off-by: Wen-chien Jesse Sung <jesse.sung at canonical.com>

Acked-by: Connor Kuehl <connor.kuehl at canonical.com>

> ---
>   drivers/usb/class/cdc-wdm.c | 7 ++++++-
>   1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c
> index 71ad04d54212..c2e3dcfa4ccd 100644
> --- a/drivers/usb/class/cdc-wdm.c
> +++ b/drivers/usb/class/cdc-wdm.c
> @@ -188,7 +188,12 @@ static void wdm_in_callback(struct urb *urb)
>   		}
>   	}
>   
> -	desc->rerr = status;
> +	/*
> +	 * Avoid propagating -EPIPE (stall) to userspace since it is
> +	 * better handled as an empty read
> +	 */
> +	desc->rerr = (status != -EPIPE) ? status : 0;
> +
>   	if (length + desc->length > desc->wMaxCommand) {
>   		/* The buffer would overflow */
>   		set_bit(WDM_OVERFLOW, &desc->flags);
> 




More information about the kernel-team mailing list