]> git.hungrycats.org Git - linux/commitdiff
USB: fix oops in cdc-wdm in case of malformed descriptors
authorOliver Neukum <oliver@neukum.org>
Fri, 17 Apr 2009 21:20:06 +0000 (21:20 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Sat, 2 May 2009 17:56:58 +0000 (10:56 -0700)
upstream commit: e13c594f3a1fc2c78e7a20d1a07974f71e4b448f

cdc-wdm needs to ignore extremely malformed descriptors.

Signed-off-by: Oliver Neukum <oliver@neukum.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
drivers/usb/class/cdc-wdm.c

index 5a8ecc045e3facb1ae6abee89867d68cf63eabb4..874d6a00697e179f67fce5f7e1d64bfcf8e3be56 100644 (file)
@@ -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;
        }