Bluetooth: Enable Atheros 0cf3:311e for firmware upload
[pandora-kernel.git] / drivers / hid / hid-ntrig.c
index 9fae2eb..48cba85 100644 (file)
@@ -115,7 +115,8 @@ static inline int ntrig_get_mode(struct hid_device *hdev)
        struct hid_report *report = hdev->report_enum[HID_FEATURE_REPORT].
                                    report_id_hash[0x0d];
 
-       if (!report)
+       if (!report || report->maxfield < 1 ||
+           report->field[0]->report_count < 1)
                return -EINVAL;
 
        usbhid_submit_report(hdev, report, USB_DIR_IN);