Skip to contentSkip to conversation

USB: CDC: fix sanity checks in CDC union parser

PATCH New Oliver Neukum 1 participant 1 message Aug 13, 2019 USB

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 USB: CDC: fix sanity checks in CDC union parser

A few checks checked for the size of the pointer to a structure instead of the structure itself. Copy & paste issue presumably.

Fixes e4c6fb7794982 ("usbnet: move the CDC parser into USB core")
Reported-by [email protected]
---
 drivers/usb/core/message.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/usb/core/message.c +2 -2
index e844bb7b5676..5adf489428aa 100644
@@ -2218,14 +2218,14 @@ int cdc_parse_cdc_header(struct usb_cdc_parsed_header *hdr,
 				(struct usb_cdc_dmm_desc *)buffer;
 			break;
 		case USB_CDC_MDLM_TYPE:
-			if (elength < sizeof(struct usb_cdc_mdlm_desc *))
+			if (elength < sizeof(struct usb_cdc_mdlm_desc))
 				goto next_desc;
 			if (desc)
 				return -EINVAL;
 			desc = (struct usb_cdc_mdlm_desc *)buffer;
 			break;
 		case USB_CDC_MDLM_DETAIL_TYPE:
-			if (elength < sizeof(struct usb_cdc_mdlm_detail_desc *))
+			if (elength < sizeof(struct usb_cdc_mdlm_detail_desc))
 				goto next_desc;
 			if (detail)
 				return -EINVAL;
Signature · 1 line
2.16.4