projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5d6c3d9
)
ethernet: ucc_geth: Use kmemdup() rather than kmalloc+memcpy
author
YueHaibing
<yuehaibing@huawei.com>
Mon, 24 May 2021 01:07:01 +0000
(09:07 +0800)
committer
David S. Miller
<davem@davemloft.net>
Mon, 24 May 2021 01:51:42 +0000
(18:51 -0700)
Issue identified with Coccinelle.
Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/ucc_geth.c
patch
|
blob
|
history
diff --git
a/drivers/net/ethernet/freescale/ucc_geth.c
b/drivers/net/ethernet/freescale/ucc_geth.c
index e0936510fa348ee180ef7961786fe793027e1167..0acfafb73db1f8ee5d6664b1e17d53a8ff262380 100644
(file)
--- a/
drivers/net/ethernet/freescale/ucc_geth.c
+++ b/
drivers/net/ethernet/freescale/ucc_geth.c
@@
-3590,10
+3590,9
@@
static int ucc_geth_probe(struct platform_device* ofdev)
if ((ucc_num < 0) || (ucc_num > 7))
return -ENODEV;
- ug_info = km
alloc(
sizeof(*ug_info), GFP_KERNEL);
+ ug_info = km
emdup(&ugeth_primary_info,
sizeof(*ug_info), GFP_KERNEL);
if (ug_info == NULL)
return -ENOMEM;
- memcpy(ug_info, &ugeth_primary_info, sizeof(*ug_info));
ug_info->uf_info.ucc_num = ucc_num;