From patchwork Tue Sep 22 00:30:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 260434 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=-14.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,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 8BD7FC4727E for ; Tue, 22 Sep 2020 00:31:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5013B23A8B for ; Tue, 22 Sep 2020 00:31:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600734693; bh=FyBS1w7w6BDRvZdUON4OStsEK2rGR18u90f2mhP0YZY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=v4tHL4dh3NTgpxc3OgiLMf/uuObQkvuURqGqoZ+S7yokPaW9NWLA2nc7MyXpSArtq gpWRd6pAlvL8nXwaja9URVfHLWCRxKFXCUe3urelg8e/LFlCDazfo4RcdjtXLknyIY aRxdV5tfJZfuKwtAeRQcRxFWAphjzeyLT1ngVlWU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729343AbgIVAbT (ORCPT ); Mon, 21 Sep 2020 20:31:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:60392 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729032AbgIVAbN (ORCPT ); Mon, 21 Sep 2020 20:31:13 -0400 Received: from sx1.lan (c-24-6-56-119.hsd1.ca.comcast.net [24.6.56.119]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3407223AA7; Tue, 22 Sep 2020 00:31:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1600734673; bh=FyBS1w7w6BDRvZdUON4OStsEK2rGR18u90f2mhP0YZY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Y9vgMyHG7aorABvDTTR2GZL+aWbEr/iuH2wLm9rZLOPgAGvZnyBR4bnHEl1v+hLID 1GXVX8Va2gTmuWzxoB7XSJeBiPrEs/Dv0ThPbp+hQuhbjFz+GZJw31g2htOkcozfm5 T7uqiQYGIURf/eIPmnf/LpZGc7ZLmAHbPHUV38UA= From: saeed@kernel.org To: "David S. Miller" , Jakub Kicinski Cc: netdev@vger.kernel.org, Jianbo Liu , Roi Dayan , Saeed Mahameed , Saeed Mahameed Subject: [net V2 04/15] net/mlx5e: Fix memory leak of tunnel info when rule under multipath not ready Date: Mon, 21 Sep 2020 17:30:50 -0700 Message-Id: <20200922003101.529117-5-saeed@kernel.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200922003101.529117-1-saeed@kernel.org> References: <20200922003101.529117-1-saeed@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Jianbo Liu When deleting vxlan flow rule under multipath, tun_info in parse_attr is not freed when the rule is not ready. Fixes: ef06c9ee8933 ("net/mlx5e: Allow one failure when offloading tc encap rules under multipath") Signed-off-by: Jianbo Liu Reviewed-by: Roi Dayan Signed-off-by: Saeed Mahameed Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c index fd53d101d8fd..7be282d2ddde 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tc.c @@ -1290,11 +1290,8 @@ static void mlx5e_tc_del_fdb_flow(struct mlx5e_priv *priv, mlx5e_put_flow_tunnel_id(flow); - if (flow_flag_test(flow, NOT_READY)) { + if (flow_flag_test(flow, NOT_READY)) remove_unready_flow(flow); - kvfree(attr->parse_attr); - return; - } if (mlx5e_is_offloaded_flow(flow)) { if (flow_flag_test(flow, SLOW))