From patchwork Thu Mar 25 05:04:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 409363 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, 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 AF76BC433E1 for ; Thu, 25 Mar 2021 05:05:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8003861A27 for ; Thu, 25 Mar 2021 05:05:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229847AbhCYFFA (ORCPT ); Thu, 25 Mar 2021 01:05:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:47898 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229508AbhCYFEp (ORCPT ); Thu, 25 Mar 2021 01:04:45 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6809661A24; Thu, 25 Mar 2021 05:04:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1616648685; bh=+IdPbWs7MYobGyl22tW3H3PzIM4BslGgGn5MjbmJmvQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RIzvKeM026qCkjnMjxrXS7p+gSR+rAPsEh4djPaMqXwoGpCzRzOMlrls66ltQJWFN SEGynT9uTTg22IhaeGr9Rf2SjzbDJ1t8sMTHwJq1MclZqE71C4x9R/clLs3MwEeS/E iIbDRyIFgY3Fmt1QV+O4BsKp4B143i3V2xxwQqwZ8XnyqwrIjSqCYPx9yc2JkzDCRo /rokoAN2mAOznRispCxNWv5vczJHS5xF1QJ74kXtZFXrkwV3foe1TbPYPCm71ZEDFh g58lIPie+dv+nDpczx9SgjJC1CeaNlvdSGk9PqiuG0x99OqEMMBDl8/AztMO9fSQ2z 85QYtNX1IF7Tg== From: Saeed Mahameed To: "David S. Miller" , Jakub Kicinski Cc: netdev@vger.kernel.org, Saeed Mahameed , Arnd Bergmann Subject: [net-next 03/15] net/mlx5e: alloc the correct size for indirection_rqt Date: Wed, 24 Mar 2021 22:04:26 -0700 Message-Id: <20210325050438.261511-4-saeed@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210325050438.261511-1-saeed@kernel.org> References: <20210325050438.261511-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 730f33ada90a..251941d3a8d7 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;