diff options
Diffstat (limited to 'drivers/hid/hid-sensor-hub.c')
-rw-r--r-- | drivers/hid/hid-sensor-hub.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/drivers/hid/hid-sensor-hub.c b/drivers/hid/hid-sensor-hub.c index 1877a2552483..e46e0134b0f9 100644 --- a/drivers/hid/hid-sensor-hub.c +++ b/drivers/hid/hid-sensor-hub.c | |||
@@ -430,11 +430,10 @@ static int sensor_hub_raw_event(struct hid_device *hdev, | |||
430 | if (pdata->pending.status && pdata->pending.attr_usage_id == | 430 | if (pdata->pending.status && pdata->pending.attr_usage_id == |
431 | report->field[i]->usage->hid) { | 431 | report->field[i]->usage->hid) { |
432 | hid_dbg(hdev, "data was pending ...\n"); | 432 | hid_dbg(hdev, "data was pending ...\n"); |
433 | pdata->pending.raw_data = kmalloc(sz, GFP_ATOMIC); | 433 | pdata->pending.raw_data = kmemdup(ptr, sz, GFP_ATOMIC); |
434 | if (pdata->pending.raw_data) { | 434 | if (pdata->pending.raw_data) |
435 | memcpy(pdata->pending.raw_data, ptr, sz); | ||
436 | pdata->pending.raw_size = sz; | 435 | pdata->pending.raw_size = sz; |
437 | } else | 436 | else |
438 | pdata->pending.raw_size = 0; | 437 | pdata->pending.raw_size = 0; |
439 | complete(&pdata->pending.ready); | 438 | complete(&pdata->pending.ready); |
440 | } | 439 | } |