Re: [RFC] USB: check for transmissible packet sizes when matching endpoints

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

 



On Thu, Nov 30, 2023 at 12:39:45PM +0100, Oliver Neukum wrote:
> Looking for a bulk endpoint to transfer data over
> we need something that can transmit data.
> 
> Signed-off-by: Oliver Neukum <oneukum@xxxxxxxx>
> ---
>  drivers/usb/core/usb.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c
> index 2a938cf47ccd..d163bd279021 100644
> --- a/drivers/usb/core/usb.c
> +++ b/drivers/usb/core/usb.c
> @@ -80,6 +80,9 @@ static bool match_endpoint(struct usb_endpoint_descriptor *epd,
>  {
>  	switch (usb_endpoint_type(epd)) {
>  	case USB_ENDPOINT_XFER_BULK:
> +		if (!usb_endpoint_maxp(epd))
> +			return false;

Why would a bulk endpoint descriptor's maxpacket size ever be 0?  Are 
there any devices that have such a thing?

If we do encounter one, it will trigger a dev_notice() in config.c's 
usb_parse_endpoint().

Alan Stern




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

  Powered by Linux