USB: fix oops in cdc-wdm in case of malformed descriptors
authorOliver Neukum <oliver@neukum.org>
Sat, 4 Apr 2009 07:25:15 +0000 (09:25 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Fri, 17 Apr 2009 17:50:24 +0000 (10:50 -0700)
cdc-wdm needs to ignore extremely malformed descriptors.

Signed-off-by: Oliver Neukum <oliver@neukum.org>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/usb/class/cdc-wdm.c

index 3771d6e..34e6108 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;
        }