diff options
-rw-r--r-- | drivers/hid/hid-sensor-hub.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/hid/hid-sensor-hub.c b/drivers/hid/hid-sensor-hub.c index ffc80cf481b4..6fca30eb377d 100644 --- 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, | |||
221 | 221 | ||
222 | mutex_lock(&data->mutex); | 222 | mutex_lock(&data->mutex); |
223 | report = sensor_hub_report(report_id, hsdev->hdev, HID_FEATURE_REPORT); | 223 | report = sensor_hub_report(report_id, hsdev->hdev, HID_FEATURE_REPORT); |
224 | if (!report || (field_index >= report->maxfield)) { | 224 | if (!report || (field_index >= report->maxfield) || |
225 | report->field[field_index]->report_count < 1) { | ||
225 | ret = -EINVAL; | 226 | ret = -EINVAL; |
226 | goto done_proc; | 227 | goto done_proc; |
227 | } | 228 | } |