]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net: stmmac: selftests: Use kcalloc() instead of kzalloc()
authorGustavo A. R. Silva <gustavoars@kernel.org>
Wed, 6 Oct 2021 18:09:44 +0000 (13:09 -0500)
committerJakub Kicinski <kuba@kernel.org>
Thu, 7 Oct 2021 16:08:33 +0000 (09:08 -0700)
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>
drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c

index 0462dcc93e536e430423b2ea113c85be34e0c7db..e649a3e6a529a8c6346223a2f84b1ab0c6729eff 100644 (file)
@@ -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;