Skip to content

Commit

Permalink
net: stmmac: selftests: Use kcalloc() instead of kzalloc()
Browse files Browse the repository at this point in the history
[ Upstream commit 3637187 ]

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

Link: KSPP/linux#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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
GustavoARSilva authored and gregkh committed Jun 9, 2022
1 parent 7386f69 commit 5c2b34d
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 5c2b34d

Please sign in to comment.