Commit 830c8ddc authored by Rasmus Villemoes's avatar Rasmus Villemoes Committed by Jakub Kicinski

ethernet: ucc_geth: replace kmalloc+memset by kzalloc

Signed-off-by: default avatarRasmus Villemoes <rasmus.villemoes@prevas.dk>
Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 0a71c415
...@@ -2904,14 +2904,11 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth) ...@@ -2904,14 +2904,11 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)
* allocated resources can be released when the channel is freed. * allocated resources can be released when the channel is freed.
*/ */
if (!(ugeth->p_init_enet_param_shadow = 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)) if (netif_msg_ifup(ugeth))
pr_err("Can not allocate memory for p_UccInitEnetParamShadows\n"); pr_err("Can not allocate memory for p_UccInitEnetParamShadows\n");
return -ENOMEM; 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 */ /* Fill shadow InitEnet command parameter structure */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment