aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid/hid-sensor-hub.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/hid/hid-sensor-hub.c')
-rw-r--r--drivers/hid/hid-sensor-hub.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/hid/hid-sensor-hub.c b/drivers/hid/hid-sensor-hub.c
index ca7498107327..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 }
@@ -416,7 +417,7 @@ static int sensor_hub_raw_event(struct hid_device *hdev,
416 return 1; 417 return 1;
417 418
418 ptr = raw_data; 419 ptr = raw_data;
419 ptr++; /*Skip report id*/ 420 ptr++; /* Skip report id */
420 421
421 spin_lock_irqsave(&pdata->lock, flags); 422 spin_lock_irqsave(&pdata->lock, flags);
422 423