From: Oliver Neukum Date: Fri, 17 Apr 2009 21:20:06 +0000 (+0000) Subject: USB: fix oops in cdc-wdm in case of malformed descriptors X-Git-Tag: v2.6.28.10~42 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=114ff4beb99fbe3ef04beea9131f11933d5c9bf6;p=thirdparty%2Fkernel%2Fstable.git USB: fix oops in cdc-wdm in case of malformed descriptors upstream commit: e13c594f3a1fc2c78e7a20d1a07974f71e4b448f cdc-wdm needs to ignore extremely malformed descriptors. Signed-off-by: Oliver Neukum Signed-off-by: Greg Kroah-Hartman Signed-off-by: Chris Wright --- diff --git a/drivers/usb/class/cdc-wdm.c b/drivers/usb/class/cdc-wdm.c index 5a8ecc045e3fa..874d6a00697e1 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; }