uwb: hwa-rc: fix NULL-deref at probe
[pandora-kernel.git] / drivers / uwb / hwa-rc.c
index 86685e9..ad971df 100644 (file)
@@ -811,6 +811,9 @@ static int hwarc_probe(struct usb_interface *iface,
        struct hwarc *hwarc;
        struct device *dev = &iface->dev;
 
+       if (iface->cur_altsetting->desc.bNumEndpoints < 1)
+               return -ENODEV;
+
        result = -ENOMEM;
        uwb_rc = uwb_rc_alloc();
        if (uwb_rc == NULL) {