projects
/
platform
/
adaptation
/
renesas_rcar
/
renesas_kernel.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
905cc19
)
HID: hid-sensor-hub: change kmalloc + memcpy by kmemdup
author
Andy Shevchenko
<andriy.shevchenko@linux.intel.com>
Wed, 14 Aug 2013 08:07:11 +0000
(11:07 +0300)
committer
Jiri Kosina
<jkosina@suse.cz>
Wed, 4 Sep 2013 10:19:13 +0000
(12:19 +0200)
The patch substitutes kmemdup for kmalloc followed by memcpy.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drivers/hid/hid-sensor-hub.c
patch
|
blob
|
history
diff --git
a/drivers/hid/hid-sensor-hub.c
b/drivers/hid/hid-sensor-hub.c
index
1877a25
..
e46e013
100644
(file)
--- 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,
if (pdata->pending.status && pdata->pending.attr_usage_id ==
report->field[i]->usage->hid) {
hid_dbg(hdev, "data was pending ...\n");
- pdata->pending.raw_data = kmalloc(sz, GFP_ATOMIC);
- if (pdata->pending.raw_data) {
- memcpy(pdata->pending.raw_data, ptr, sz);
+ pdata->pending.raw_data = kmemdup(ptr, sz, GFP_ATOMIC);
+ if (pdata->pending.raw_data)
pdata->pending.raw_size = sz;
-
}
else
+ else
pdata->pending.raw_size = 0;
complete(&pdata->pending.ready);
}