]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - drivers/hid/hid-sensor-hub.c
Merge branch 'for-3.12/sensor-hub' into for-linus
[mirror_ubuntu-artful-kernel.git] / drivers / hid / hid-sensor-hub.c
index e46e0134b0f979b5a77c8576e77a819f98ee9108..10e1581022cfdea4acd4e5431ea43155e83898f0 100644 (file)
@@ -220,7 +220,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);
-       if (!report || (field_index >= report->maxfield)) {
+       if (!report || (field_index >= report->maxfield) ||
+           report->field[field_index]->report_count < 1) {
                ret = -EINVAL;
                goto done_proc;
        }
@@ -416,7 +417,7 @@ static int sensor_hub_raw_event(struct hid_device *hdev,
                return 1;
 
        ptr = raw_data;
-       ptr++; /*Skip report id*/
+       ptr++; /* Skip report id */
 
        spin_lock_irqsave(&pdata->lock, flags);