From patchwork Wed Oct 6 18:09:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Gustavo A. R. Silva" X-Patchwork-Id: 12540235 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C2F76C433EF for ; Wed, 6 Oct 2021 18:07:55 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7EC7461039 for ; Wed, 6 Oct 2021 18:07:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 7EC7461039 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Subject:Cc:To: From:Date:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=NItJ5VuSDoQts9ddV4Iu0pXtdpygAoT32t4ZX37vo/Q=; b=R0vz119mi5P6Ak yVIQK9nhlTJ+a10upKfS95afbieO9n4VTUSk5cX2oeX+nvzXr1tvKONevHp0QtvnSWUOb7cLFc8vn 3OWK6bvhaGtNUBFFnhBFY59OvAO2gKzCZhBy5vb8JfyyzYyE9Ub1CVVyQysQgP23U1kU+rn8wyb5y JGoVfdUE53kYQCbtj1wJvCA+toJv48SW66gviXYvWSm99krqk9B97AuHd2KQGSIuaDoH78sGuDvr8 7A6X3S91IkcMRrmdly38y8SVlJW+fYjP6XuIUzW+yO/8pU2JsuCo7P3wyCjJRza4BnTxZpwVUqoqW jt2UyrIZCdkMcmYAGKxw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mYBIW-00FILe-Js; Wed, 06 Oct 2021 18:05:44 +0000 Received: from mail.kernel.org ([198.145.29.99]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mYBIS-00FIKz-6r for linux-arm-kernel@lists.infradead.org; Wed, 06 Oct 2021 18:05:41 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 90F4561037; Wed, 6 Oct 2021 18:05:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1633543539; bh=5YNmGloASLfZX1qBz/WxSnaeRHiHJ2EubVXj2iaSHM0=; h=Date:From:To:Cc:Subject:From; b=mTajuYWmuAbYfmmJ2yFqXn0e/aHYDF6JA+KY2WuaELoHe+xqZ841z+zau9aLkywaJ XhzkpSwLwfI7+rAjlhryLne8EOttKFipx8GKarwcNmyv9S+ohWYY9GClq/dfg41TcP PJ1/OqOnAluSfaxUKVcJePPWtk3o2xz54v0O8CUNN9OVIIqIwSLVq+zcmc5ws1VSeG ROHtLOqBA+ClJKOLDtV1+U7YMPu92NrUTDDouKGrruFfwNxWfstdsEoe3CDVk7JyXc Yzji/y9Ir2Q8tzAluOhVj+bkKpEdZ3nJVerdb1DZqIqsMwxalF5CoAY/25qa/Ui8oD GfVJpURW+sVsA== Date: Wed, 6 Oct 2021 13:09:44 -0500 From: "Gustavo A. R. Silva" To: Giuseppe Cavallaro , Alexandre Torgue , Jose Abreu , "David S. Miller" , Jakub Kicinski , Maxime Coquelin Cc: netdev@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, "Gustavo A. R. Silva" , linux-hardening@vger.kernel.org Subject: [PATCH][next] net: stmmac: selftests: Use kcalloc() instead of kzalloc() Message-ID: <20211006180944.GA913477@embeddedor> MIME-Version: 1.0 Content-Disposition: inline X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211006_110540_294316_F6246734 X-CRM114-Status: UNSURE ( 9.35 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 --- drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c index 0462dcc93e53..e649a3e6a529 100644 --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c @@ -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;