USB: serial: io_edgeport: fix NULL-deref at open
[pandora-kernel.git] / drivers / usb / serial / io_edgeport.c
index 0af0b41..5a76b1c 100644 (file)
@@ -2936,6 +2936,11 @@ static int edge_startup(struct usb_serial *serial)
                                        EDGE_COMPATIBILITY_MASK1,
                                        EDGE_COMPATIBILITY_MASK2 };
 
                                        EDGE_COMPATIBILITY_MASK1,
                                        EDGE_COMPATIBILITY_MASK2 };
 
+       if (serial->num_bulk_in < 1 || serial->num_interrupt_in < 1) {
+               dev_err(&serial->interface->dev, "missing endpoints\n");
+               return -ENODEV;
+       }
+
        dev = serial->dev;
 
        /* create our private serial structure */
        dev = serial->dev;
 
        /* create our private serial structure */