From patchwork Wed Apr 7 04:06:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 417254 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.0 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 51452C433ED for ; Wed, 7 Apr 2021 04:06:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 190EC6124C for ; Wed, 7 Apr 2021 04:06:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229748AbhDGEGz (ORCPT ); Wed, 7 Apr 2021 00:06:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:52162 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229505AbhDGEGw (ORCPT ); Wed, 7 Apr 2021 00:06:52 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C069A613CE; Wed, 7 Apr 2021 04:06:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1617768403; bh=31W5DVZmsPZhibGtQ5uhY7B0+WfV2eB4IqtkL45RwMs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iOIXaU3+5koMPnJY70qjeXOcEENR+dnfQmg6l1CmtdEoKqwXTwq169wfdY+saUQZx qNcx0tkpofE5wt+hQ0a2rab85KkRntHcon/OK5tj4NZ050wcB+UapQl80mu/14Zu/z ibRAWMQY3h29F239AKuFQaOnW0kupj2hid9uGSqSbryYY5APBSh0LSVWLNQdqLQN0o qYYwFTEXi1L+c2chqvNkwdkMtu6wbrexI5NO5k3b9tPH7g7pf/O6icN2ntEwtJ93iZ YAN3l8Nj2sF/dFUTnPANT8ayMYeIuvXpgGjj9vMMFWdGn24uUeC1BZFQpgv6ql4dH4 pfyJChG0Z0oHw== From: Saeed Mahameed To: "David S. Miller" , Jakub Kicinski Cc: netdev@vger.kernel.org, Tariq Toukan , Xiaoming Ni , Leon Romanovsky , Saeed Mahameed Subject: [net 5/5] net/mlx5: fix kfree mismatch in indir_table.c Date: Tue, 6 Apr 2021 21:06:20 -0700 Message-Id: <20210407040620.96841-6-saeed@kernel.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210407040620.96841-1-saeed@kernel.org> References: <20210407040620.96841-1-saeed@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Xiaoming Ni Memory allocated by kvzalloc() should be freed by kvfree(). Fixes: 34ca65352ddf2 ("net/mlx5: E-Switch, Indirect table infrastructur") Signed-off-by: Xiaoming Ni Reviewed-by: Leon Romanovsky Signed-off-by: Saeed Mahameed --- .../net/ethernet/mellanox/mlx5/core/esw/indir_table.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/esw/indir_table.c b/drivers/net/ethernet/mellanox/mlx5/core/esw/indir_table.c index 6f6772bf61a2..3da7becc1069 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/esw/indir_table.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/esw/indir_table.c @@ -248,7 +248,7 @@ static int mlx5_esw_indir_table_rule_get(struct mlx5_eswitch *esw, err_ethertype: kfree(rule); out: - kfree(rule_spec); + kvfree(rule_spec); return err; } @@ -328,7 +328,7 @@ static int mlx5_create_indir_recirc_group(struct mlx5_eswitch *esw, e->recirc_cnt = 0; out: - kfree(in); + kvfree(in); return err; } @@ -347,7 +347,7 @@ static int mlx5_create_indir_fwd_group(struct mlx5_eswitch *esw, spec = kvzalloc(sizeof(*spec), GFP_KERNEL); if (!spec) { - kfree(in); + kvfree(in); return -ENOMEM; } @@ -371,8 +371,8 @@ static int mlx5_create_indir_fwd_group(struct mlx5_eswitch *esw, } err_out: - kfree(spec); - kfree(in); + kvfree(spec); + kvfree(in); return err; }