From: Sakari Ailus Date: Wed, 20 Aug 2025 14:38:16 +0000 (+0300) Subject: usb: core: Use le16_to_cpu() to read __le16 value in usb_parse_endpoint() X-Git-Tag: v6.18-rc1~76^2~42^2~8 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=970076537efd847c6f74ba9ed888b9cdbf71206e;p=thirdparty%2Fkernel%2Flinux.git usb: core: Use le16_to_cpu() to read __le16 value in usb_parse_endpoint() wMaxPacketSize field in struct usb_endpoint_descriptor is an __le16, use le16_to_cpu() to read it. Signed-off-by: Sakari Ailus Acked-by: Mathias Nyman Signed-off-by: Greg Kroah-Hartman Link: https://lore.kernel.org/r/20250820143824.551777-2-sakari.ailus@linux.intel.com --- diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c index 42468bbeffd22..cda595b4014fb 100644 --- a/drivers/usb/core/config.c +++ b/drivers/usb/core/config.c @@ -507,7 +507,7 @@ static int usb_parse_endpoint(struct device *ddev, int cfgno, } /* Parse a possible eUSB2 periodic endpoint companion descriptor */ - if (bcdUSB == 0x0220 && d->wMaxPacketSize == 0 && + if (bcdUSB == 0x0220 && !le16_to_cpu(d->wMaxPacketSize) && (usb_endpoint_xfer_isoc(d) || usb_endpoint_xfer_int(d))) usb_parse_eusb2_isoc_endpoint_companion(ddev, cfgno, inum, asnum, endpoint, buffer, size);