Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

ethernet: ucc_geth: Use kmemdup() rather than kmalloc+memcpy

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>

authored by

YueHaibing and committed by
David S. Miller
ec7d6dd8 5d6c3d91

+1 -2
+1 -2
drivers/net/ethernet/freescale/ucc_geth.c
··· 3590 3590 if ((ucc_num < 0) || (ucc_num > 7)) 3591 3591 return -ENODEV; 3592 3592 3593 - ug_info = kmalloc(sizeof(*ug_info), GFP_KERNEL); 3593 + ug_info = kmemdup(&ugeth_primary_info, sizeof(*ug_info), GFP_KERNEL); 3594 3594 if (ug_info == NULL) 3595 3595 return -ENOMEM; 3596 - memcpy(ug_info, &ugeth_primary_info, sizeof(*ug_info)); 3597 3596 3598 3597 ug_info->uf_info.ucc_num = ucc_num; 3599 3598