summaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>2022-11-25 13:23:58 +0100
committerJakub Kicinski <kuba@kernel.org>2022-11-30 20:42:19 -0800
commitb6a0ecaee2e683479353d0403fa31dcb4bd2be3a (patch)
treecde9f75c19058a9f6bd6c87c8ed9953031d814f6 /drivers/net
parent2450d7d93fd2424dfacbf4aebf3fa8829df9d16e (diff)
downloadlinux-b6a0ecaee2e683479353d0403fa31dcb4bd2be3a.tar.bz2
octeontx2-af: Slightly simplify rvu_npc_exact_init()
Use kzalloc() instead of kmalloc()/memset(). Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Link: https://lore.kernel.org/r/60ea220ccf3b61963f7d5a97e3df2c76a5feb837.1669378798.git.christophe.jaillet@wanadoo.fr Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.c b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.c
index 5e6c54577a97..c584680f2d2b 100644
--- a/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.c
+++ b/drivers/net/ethernet/marvell/octeontx2/af/rvu_npc_hash.c
@@ -1870,12 +1870,11 @@ int rvu_npc_exact_init(struct rvu *rvu)
/* Set capability to true */
rvu->hw->cap.npc_exact_match_enabled = true;
- table = kmalloc(sizeof(*table), GFP_KERNEL);
+ table = kzalloc(sizeof(*table), GFP_KERNEL);
if (!table)
return -ENOMEM;
dev_dbg(rvu->dev, "%s: Memory allocation for table success\n", __func__);
- memset(table, 0, sizeof(*table));
rvu->hw->table = table;
/* Read table size, ways and depth */