From: Oliver Neukum Date: Sat, 4 Apr 2009 07:25:15 +0000 (+0200) Subject: USB: fix oops in cdc-wdm in case of malformed descriptors X-Git-Tag: firefly_0821_release~14424^2~17 X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=e13c594f3a1fc2c78e7a20d1a07974f71e4b448f;p=firefly-linux-kernel-4.4.55.git USB: fix oops in cdc-wdm in case of malformed descriptors cdc-wdm needs to ignore extremely malformed descriptors. Signed-off-by: Oliver Neukum Cc: stable Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c index 3771d6e6d0cc..34e6108e1d42 100644 --- a/drivers/usb/class/cdc-wdm.c +++ b/drivers/usb/class/cdc-wdm.c @@ -652,7 +652,7 @@ next_desc: iface = &intf->altsetting[0]; ep = &iface->endpoint[0].desc; - if (!usb_endpoint_is_int_in(ep)) { + if (!ep || !usb_endpoint_is_int_in(ep)) { rv = -EINVAL; goto err; }