|
@@ -221,7 +221,8 @@ int sensor_hub_get_feature(struct hid_sensor_hub_device *hsdev, u32 report_id,
|
|
|
|
|
|
mutex_lock(&data->mutex);
|
|
mutex_lock(&data->mutex);
|
|
report = sensor_hub_report(report_id, hsdev->hdev, HID_FEATURE_REPORT);
|
|
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;
|
|
ret = -EINVAL;
|
|
goto done_proc;
|
|
goto done_proc;
|
|
}
|
|
}
|