net: mana: Use kcalloc() instead of kzalloc()
PATCH 1/1 net: mana: Use kcalloc() instead of kzalloc()
Use 2-factor multiplication argument form kcalloc() instead of kzalloc().
--- drivers/net/ethernet/microsoft/mana/hw_channel.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/microsoft/mana/hw_channel.c +2 -2
@@ -363,7 +363,7 @@ static int mana_hwc_create_cq(struct hw_channel_context *hwc, u16 q_depth, } hwc_cq->gdma_cq = cq; - comp_buf =kcalloc (q_depth,sizeof (struct gdma_comp ),GFP_KERNEL ); + comp_buf =kcalloc (q_depth,sizeof (*comp_buf),GFP_KERNEL );if (!comp_buf) { err = -ENOMEM ; goto out;
@@ -580,7 +580,7 @@ static int mana_hwc_test_channel(struct hw_channel_context *hwc, u16 q_depth,return err; } - ctx =kzalloc (q_depth *sizeof (struct hwc_caller_ctx ),GFP_KERNEL ); + ctx =kcalloc (q_depth,sizeof (*ctx),GFP_KERNEL );if (!ctx)return -ENOMEM ;
Signature · 1 line
2.27.0
Quoted 4 lines
From: Gustavo A. R. Silva <[email protected]>
Sent: Wednesday, October 6, 2021 11:09 AM
...
Subject: [PATCH][next] net: mana: Usekcalloc()instead ofkzalloc()
The [next] should be [net-next], butI guess David can fix this for you :-)
Reviewed-by Dexuan Cui <[email protected]>