projects
/
firefly-linux-kernel-4.4.55.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
Merge remote-tracking branch 'lsk/v3.10/topic/arm64-misc' into linux-linaro-lsk
[firefly-linux-kernel-4.4.55.git]
/
drivers
/
hid
/
hid-ntrig.c
diff --git
a/drivers/hid/hid-ntrig.c
b/drivers/hid/hid-ntrig.c
index ef95102515e4d499143dd02a831481902d674b1e..5482156ab4debd2bfea4e7e47c36f9df7f0de678 100644
(file)
--- a/
drivers/hid/hid-ntrig.c
+++ b/
drivers/hid/hid-ntrig.c
@@
-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;
hid_hw_request(hdev, report, HID_REQ_GET_REPORT);