Commit 149ef7b2 authored by Gustavo A. R. Silva's avatar Gustavo A. R. Silva Committed by Jakub Kicinski

net: mana: Use kcalloc() instead of kzalloc()

Use 2-factor multiplication argument form kcalloc() instead
of kzalloc().

Link: https://github.com/KSPP/linux/issues/162Signed-off-by: default avatarGustavo A. R. Silva <gustavoars@kernel.org>
Reviewed-by: default avatarDexuan Cui <decui@microsoft.com>
Link: https://lore.kernel.org/r/20211006180927.GA913456@embeddedorSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 2b8a0f15
...@@ -363,7 +363,7 @@ static int mana_hwc_create_cq(struct hw_channel_context *hwc, u16 q_depth, ...@@ -363,7 +363,7 @@ static int mana_hwc_create_cq(struct hw_channel_context *hwc, u16 q_depth,
} }
hwc_cq->gdma_cq = cq; 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) { if (!comp_buf) {
err = -ENOMEM; err = -ENOMEM;
goto out; goto out;
...@@ -580,7 +580,7 @@ static int mana_hwc_test_channel(struct hw_channel_context *hwc, u16 q_depth, ...@@ -580,7 +580,7 @@ static int mana_hwc_test_channel(struct hw_channel_context *hwc, u16 q_depth,
return err; return err;
} }
ctx = kzalloc(q_depth * sizeof(struct hwc_caller_ctx), GFP_KERNEL); ctx = kcalloc(q_depth, sizeof(*ctx), GFP_KERNEL);
if (!ctx) if (!ctx)
return -ENOMEM; return -ENOMEM;
......
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