提交 7b0692f1 编写于 作者: A Andy Shevchenko 提交者: Jiri Kosina

HID: hid-sensor-hub: change kmalloc + memcpy by kmemdup

The patch substitutes kmemdup for kmalloc followed by memcpy.
Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: NSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: NJiri Kosina <jkosina@suse.cz>
上级 905cc199
......@@ -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);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册