Skip to content

Commit

Permalink
net: stmmac: selftests: Use kcalloc() instead of kzalloc()
Browse files Browse the repository at this point in the history
Use 2-factor multiplication argument form kcalloc() instead
of kzalloc().

Link: https://github.com/KSPP/linux/issues/162
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Link: https://lore.kernel.org/r/20211006180944.GA913477@embeddedor
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
  • Loading branch information
Gustavo A. R. Silva authored and Jakub Kicinski committed Oct 7, 2021
1 parent 149ef7b commit 3637187
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c
Original file line number Diff line number Diff line change
Expand Up @@ -1104,13 +1104,13 @@ static int stmmac_test_rxp(struct stmmac_priv *priv)
goto cleanup_sel;
}

actions = kzalloc(nk * sizeof(*actions), GFP_KERNEL);
actions = kcalloc(nk, sizeof(*actions), GFP_KERNEL);
if (!actions) {
ret = -ENOMEM;
goto cleanup_exts;
}

act = kzalloc(nk * sizeof(*act), GFP_KERNEL);
act = kcalloc(nk, sizeof(*act), GFP_KERNEL);
if (!act) {
ret = -ENOMEM;
goto cleanup_actions;
Expand Down

0 comments on commit 3637187

Please sign in to comment.