projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
425902f
)
w1: ds2490: use kmemdup rather than duplicating its implementation
author
Wei Yongjun
<weiyongjun1@huawei.com>
Thu, 9 Feb 2017 15:45:42 +0000
(15:45 +0000)
committer
Greg Kroah-Hartman
<gregkh@linuxfoundation.org>
Fri, 10 Feb 2017 14:32:53 +0000
(15:32 +0100)
Use kmemdup rather than duplicating its implementation.
Generated by: scripts/coccinelle/api/memdup.cocci
Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Acked-by: Maciej S. Szmigiero <mail@maciej.szmigiero.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/w1/masters/ds2490.c
patch
|
blob
|
history
diff --git
a/drivers/w1/masters/ds2490.c
b/drivers/w1/masters/ds2490.c
index 59d74d1b47a88d82c54ee843ee368c7120150c41..be77b7914fad46aa11dd9184a5ddafeb2b762bab 100644
(file)
--- a/
drivers/w1/masters/ds2490.c
+++ b/
drivers/w1/masters/ds2490.c
@@
-909,11
+909,10
@@
static void ds9490r_write_block(void *data, const u8 *buf, int len)
if (len <= 0)
return;
- tbuf = km
alloc(
len, GFP_KERNEL);
+ tbuf = km
emdup(buf,
len, GFP_KERNEL);
if (!tbuf)
return;
- memcpy(tbuf, buf, len);
ds_write_block(dev, tbuf, len);
kfree(tbuf);