From: Rasmus Villemoes Date: Tue, 19 Jan 2021 15:07:52 +0000 (+0100) Subject: ethernet: ucc_geth: replace kmalloc+memset by kzalloc X-Git-Tag: v5.15~1802^2~284^2~10 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=830c8ddc66df5074075933a172b6698acbadbc7a;p=platform%2Fkernel%2Flinux-starfive.git ethernet: ucc_geth: replace kmalloc+memset by kzalloc Signed-off-by: Rasmus Villemoes Signed-off-by: Jakub Kicinski --- diff --git a/drivers/net/ethernet/freescale/ucc_geth.c b/drivers/net/ethernet/freescale/ucc_geth.c index be997b5..74ee2ed 100644 --- a/drivers/net/ethernet/freescale/ucc_geth.c +++ b/drivers/net/ethernet/freescale/ucc_geth.c @@ -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 */