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 5c925228847c..4ef73374a8f9 100644 --- a/drivers/hid/hid-sensor-hub.c +++ b/drivers/hid/hid-sensor-hub.c | |||
| @@ -212,7 +212,6 @@ int sensor_hub_set_feature(struct hid_sensor_hub_device *hsdev, u32 report_id, | |||
| 212 | __s32 value; | 212 | __s32 value; |
| 213 | int ret = 0; | 213 | int ret = 0; |
| 214 | 214 | ||
| 215 | memset(buffer, 0, buffer_size); | ||
| 216 | mutex_lock(&data->mutex); | 215 | mutex_lock(&data->mutex); |
| 217 | report = sensor_hub_report(report_id, hsdev->hdev, HID_FEATURE_REPORT); | 216 | report = sensor_hub_report(report_id, hsdev->hdev, HID_FEATURE_REPORT); |
| 218 | if (!report || (field_index >= report->maxfield)) { | 217 | if (!report || (field_index >= report->maxfield)) { |
| @@ -256,6 +255,8 @@ int sensor_hub_get_feature(struct hid_sensor_hub_device *hsdev, u32 report_id, | |||
| 256 | int buffer_index = 0; | 255 | int buffer_index = 0; |
| 257 | int i; | 256 | int i; |
| 258 | 257 | ||
| 258 | memset(buffer, 0, buffer_size); | ||
| 259 | |||
| 259 | mutex_lock(&data->mutex); | 260 | mutex_lock(&data->mutex); |
| 260 | report = sensor_hub_report(report_id, hsdev->hdev, HID_FEATURE_REPORT); | 261 | report = sensor_hub_report(report_id, hsdev->hdev, HID_FEATURE_REPORT); |
| 261 | if (!report || (field_index >= report->maxfield) || | 262 | if (!report || (field_index >= report->maxfield) || |
