projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
958c492
)
r8152: Use kmemdup instead of kmalloc + memcpy
author
Benoit Taine
<
[email protected]
>
Mon, 26 May 2014 15:21:23 +0000
(17:21 +0200)
committer
David S. Miller
<
[email protected]
>
Fri, 30 May 2014 23:25:15 +0000
(16:25 -0700)
This issue was reported by coccicheck using the semantic patch
at scripts/coccinelle/api/memdup.cocci
Signed-off-by: Benoit Taine <
[email protected]
>
Signed-off-by: David S. Miller <
[email protected]
>
drivers/net/usb/r8152.c
patch
|
blob
|
history
diff --git
a/drivers/net/usb/r8152.c
b/drivers/net/usb/r8152.c
index 9f91c7aba4b0c7961bca73593411d821c751566b..25431965a625a63d99fd3fa6d3167183ea45606a 100644
(file)
--- a/
drivers/net/usb/r8152.c
+++ b/
drivers/net/usb/r8152.c
@@
-630,12
+630,10
@@
int set_registers(struct r8152 *tp, u16 value, u16 index, u16 size, void *data)
int ret;
void *tmp;
- tmp = km
alloc(
size, GFP_KERNEL);
+ tmp = km
emdup(data,
size, GFP_KERNEL);
if (!tmp)
return -ENOMEM;
- memcpy(tmp, data, size);
-
ret = usb_control_msg(tp->udev, usb_sndctrlpipe(tp->udev, 0),
RTL8152_REQ_SET_REGS, RTL8152_REQT_WRITE,
value, index, tmp, size, 500);