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 tag 'kvm-for-lsk-v3.10-v1' of git://git.linaro.org/people/christoffer.dall...
[firefly-linux-kernel-4.4.55.git]
/
drivers
/
hid
/
hid-sensor-hub.c
diff --git
a/drivers/hid/hid-sensor-hub.c
b/drivers/hid/hid-sensor-hub.c
index ca74981073271effdddc72ba1f173acea27ebbf9..aa34755ca205eb6955cb10b01b2a6b01bc1a3dd1 100644
(file)
--- a/
drivers/hid/hid-sensor-hub.c
+++ b/
drivers/hid/hid-sensor-hub.c
@@
-221,7
+221,8
@@
int sensor_hub_get_feature(struct hid_sensor_hub_device *hsdev, u32 report_id,
mutex_lock(&data->mutex);
report = sensor_hub_report(report_id, hsdev->hdev, HID_FEATURE_REPORT);
mutex_lock(&data->mutex);
report = sensor_hub_report(report_id, hsdev->hdev, HID_FEATURE_REPORT);
- if (!report || (field_index >= report->maxfield)) {
+ if (!report || (field_index >= report->maxfield) ||
+ report->field[field_index]->report_count < 1) {
ret = -EINVAL;
goto done_proc;
}
ret = -EINVAL;
goto done_proc;
}