From patchwork Fri Mar 12 23:38:42 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 12136183 X-Patchwork-Delegate: kuba@kernel.org 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 84C1EC4332B for ; Fri, 12 Mar 2021 23:40:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 489C964EDF for ; Fri, 12 Mar 2021 23:40:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235873AbhCLXj0 (ORCPT ); Fri, 12 Mar 2021 18:39:26 -0500 Received: from mail.kernel.org ([198.145.29.99]:32770 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235807AbhCLXi5 (ORCPT ); Fri, 12 Mar 2021 18:38:57 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4AF5764F9E; Fri, 12 Mar 2021 23:38:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1615592337; bh=zX7z9HLXP3KcnCpLp0CbrwdOtAOyjZEY6/JC/WiSwJM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=McxHBrwbqQ/yTUjoFLXMsTDOJyVBlEoBg1cvhdiyS0l9JDsBUeUwK27KQ3cdkfSgD 8cKzMJhYeBNpe2W0L8B82oRyU7TWWLEL7i3XV9f0nkxFgjujUfnm7mOiHYgEauCyKq rzW6ElZWKYQAfd/xK9Cyj3VqNUXH6s1UoCOaCn6B5jFmeAXVW8LlmrMo1OL4lBybzd xJHTD9TbO5KHjMJbNht7qsOCRSXkMyw047GnRxBd3Zz6yjhSOxk4Mcy90lpHzddMef uas/+tbm24WddqNywJlnCivIqNNAsbciFLBHD2u8XARoWFfXXP0bnOe903pcQfWpWS 8zA/UQS3/5zXg== From: Saeed Mahameed To: "David S. Miller" , Jakub Kicinski Cc: netdev@vger.kernel.org, Junlin Yang , Roi Dayan , Saeed Mahameed Subject: [net-next 04/13] net/mlx5: use kvfree() for memory allocated with kvzalloc() Date: Fri, 12 Mar 2021 15:38:42 -0800 Message-Id: <20210312233851.494832-5-saeed@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20210312233851.494832-1-saeed@kernel.org> References: <20210312233851.494832-1-saeed@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org From: Junlin Yang It is allocated with kvzalloc(), the corresponding release function should not be kfree(), use kvfree() instead. Generated by: scripts/coccinelle/api/kfree_mismatch.cocci Signed-off-by: Junlin Yang Reviewed-by: Roi Dayan 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; }