mirror of
https://github.com/edk2-porting/linux-next.git
synced 2025-01-06 12:44:14 +08:00
ethernet: ucc_geth: replace kmalloc+memset by kzalloc
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@prevas.dk> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
parent
0a71c41529
commit
830c8ddc66
@ -2904,14 +2904,11 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
|
||||
* allocated resources can be released when the channel is freed.
|
||||
*/
|
||||
if (!(ugeth->p_init_enet_param_shadow =
|
||||
kmalloc(sizeof(struct ucc_geth_init_pram), GFP_KERNEL))) {
|
||||
kzalloc(sizeof(struct ucc_geth_init_pram), GFP_KERNEL))) {
|
||||
if (netif_msg_ifup(ugeth))
|
||||
pr_err("Can not allocate memory for p_UccInitEnetParamShadows\n");
|
||||
return -ENOMEM;
|
||||
}
|
||||
/* Zero out *p_init_enet_param_shadow */
|
||||
memset((char *)ugeth->p_init_enet_param_shadow,
|
||||
0, sizeof(struct ucc_geth_init_pram));
|
||||
|
||||
/* Fill shadow InitEnet command parameter structure */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user