[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20201205191744.7847-10-rasmus.villemoes@prevas.dk>
Date: Sat, 5 Dec 2020 20:17:32 +0100
From: Rasmus Villemoes <rasmus.villemoes@...vas.dk>
To: Li Yang <leoyang.li@....com>,
"David S. Miller" <davem@...emloft.net>,
Jakub Kicinski <kuba@...nel.org>
Cc: Zhao Qiang <qiang.zhao@....com>,
Vladimir Oltean <vladimir.oltean@....com>,
Rasmus Villemoes <rasmus.villemoes@...vas.dk>,
netdev@...r.kernel.org, linuxppc-dev@...ts.ozlabs.org,
linux-kernel@...r.kernel.org
Subject: [PATCH 09/20] ethernet: ucc_geth: replace kmalloc+memset by kzalloc
Signed-off-by: Rasmus Villemoes <rasmus.villemoes@...vas.dk>
---
drivers/net/ethernet/freescale/ucc_geth.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/drivers/net/ethernet/freescale/ucc_geth.c b/drivers/net/ethernet/freescale/ucc_geth.c
index f854ff90f238..e1574c14b7e5 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 */
--
2.23.0
Powered by blists - more mailing lists