Browse Source

USB: fix oops in cdc-wdm in case of malformed descriptors

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>
Oliver Neukum 16 years ago
parent
commit
e13c594f3a
1 changed files with 1 additions and 1 deletions
  1. 1 1
      drivers/usb/class/cdc-wdm.c

+ 1 - 1
drivers/usb/class/cdc-wdm.c

@@ -652,7 +652,7 @@ next_desc:
 
 
 	iface = &intf->altsetting[0];
 	iface = &intf->altsetting[0];
 	ep = &iface->endpoint[0].desc;
 	ep = &iface->endpoint[0].desc;
-	if (!usb_endpoint_is_int_in(ep)) {
+	if (!ep || !usb_endpoint_is_int_in(ep)) {
 		rv = -EINVAL;
 		rv = -EINVAL;
 		goto err;
 		goto err;
 	}
 	}