From patchwork Fri Mar 26 02:53:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 409997 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-19.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_CR_TRAILER, INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3A449C433C1 for ; Fri, 26 Mar 2021 02:54:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0653E61A38 for ; Fri, 26 Mar 2021 02:54:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231193AbhCZCyQ (ORCPT ); Thu, 25 Mar 2021 22:54:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:37558 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230445AbhCZCxt (ORCPT ); Thu, 25 Mar 2021 22:53:49 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8064661A38; Fri, 26 Mar 2021 02:53:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1616727228; bh=Xq1Dra7hnQa5npJtZegCaoKR2PfFAzHmk8TxOd4oFWQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AhxkCVN8i9VokU3k9ZlFxxpqL0xuL3lUNfJpyNVkXn+uXDdQBOtbfrzJCuJWgrshd RVmPRXLq89E3gAHvlX4U5zVMZg0WhkdUqRzdwmvIVgfvSKksQ4k02+opOyDlP7ISa5 821D6QT46poyRQ8gQYGE3ARLBvZCvyBkqN6h6TXBRrcd/opKwfLRUAb8rc/IG/TdsZ +ZCRffjT5y2Nih7iLv+hHIJU6ZfmWdTRVKa6nZsrmpUTM4gi6Ipu28jp2WUbMqnvMZ thoRSuI2ExEAByg6bOjTghKusRRef8w0NEFX1YDAW6cQmLezKEmDMkTDTewtpQrKnE rv0Cp8+pvTB6Q== From: Saeed Mahameed To: "David S. Miller" , Jakub Kicinski Cc: netdev@vger.kernel.org, Saeed Mahameed , Arnd Bergmann Subject: [net-next V2 01/13] net/mlx5e: alloc the correct size for indirection_rqt Date: Thu, 25 Mar 2021 19:53:33 -0700 Message-Id: <20210326025345.456475-2-saeed@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210326025345.456475-1-saeed@kernel.org> References: <20210326025345.456475-1-saeed@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Saeed Mahameed The cited patch allocated the wrong size for the indirection_rqt table, fix that. Fixes: 2119bda642c4 ("net/mlx5e: allocate 'indirection_rqt' buffer dynamically") CC: Arnd Bergmann Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c index 4bd882a1018c..dbc06c71c170 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c @@ -447,11 +447,11 @@ static void mlx5e_hairpin_destroy_transport(struct mlx5e_hairpin *hp) static int mlx5e_hairpin_fill_rqt_rqns(struct mlx5e_hairpin *hp, void *rqtc) { - u32 *indirection_rqt, rqn; struct mlx5e_priv *priv = hp->func_priv; int i, ix, sz = MLX5E_INDIR_RQT_SIZE; + u32 *indirection_rqt, rqn; - indirection_rqt = kzalloc(sz, GFP_KERNEL); + indirection_rqt = kcalloc(sz, sizeof(*indirection_rqt), GFP_KERNEL); if (!indirection_rqt) return -ENOMEM;