From patchwork Tue Aug 10 03:59:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saeed Mahameed X-Patchwork-Id: 494825 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.7 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 826C8C4338F for ; Tue, 10 Aug 2021 04:00:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 590DE60FC4 for ; Tue, 10 Aug 2021 04:00:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229649AbhHJEAV (ORCPT ); Tue, 10 Aug 2021 00:00:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:39264 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230008AbhHJEAG (ORCPT ); Tue, 10 Aug 2021 00:00:06 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 97CC561051; Tue, 10 Aug 2021 03:59:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1628567985; bh=nfsLYVKii38KA1BX1DoKYDnd+mnbX1oLvbkjiAb5AVU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Hsgk1txF2UDFhIfNHQ+Mvqd01XXZAxYtyGnjkc0f1gVP7YNNYTAy1LqA+Pc5cHoKP 9Z8DHerqrnAIfG4WliCn7AQVnauUBoZSm0QcLlwto20WYlp2ziIueVczOAq+Zld56Z d8zaMm7hFQyppn7Y8K9j6OHd6dLOXG6VZ5//WHLapTenSHiCTc/MZ1bAxcslvOigNI 5XM9lU2XJZAK1kAWolz4UQY2mVas/0t8p6l90N4ZQ55B8Ekx6o6f4wNBYfvYs/HQNi +TbSid9yx/uCdiTpKO0fYv/MTNXynYczu4Zf4POo6NJrlueJtituo1eObmgwXF7bQL wgVGuWz99VTrg== From: Saeed Mahameed To: "David S. Miller" , Jakub Kicinski Cc: netdev@vger.kernel.org, Leon Romanovsky , Tariq Toukan , Chris Mi , Oz Shlomo , Saeed Mahameed Subject: [net 10/12] net/mlx5e: TC, Fix error handling memory leak Date: Mon, 9 Aug 2021 20:59:21 -0700 Message-Id: <20210810035923.345745-11-saeed@kernel.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210810035923.345745-1-saeed@kernel.org> References: <20210810035923.345745-1-saeed@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Chris Mi Free the offload sample action on error. Fixes: f94d6389f6a8 ("net/mlx5e: TC, Add support to offload sample action") Signed-off-by: Chris Mi Reviewed-by: Oz Shlomo Signed-off-by: Saeed Mahameed --- drivers/net/ethernet/mellanox/mlx5/core/esw/sample.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/esw/sample.c b/drivers/net/ethernet/mellanox/mlx5/core/esw/sample.c index 794012c5c476..d3ad78aa9d45 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/esw/sample.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/esw/sample.c @@ -501,6 +501,7 @@ mlx5_esw_sample_offload(struct mlx5_esw_psample *esw_psample, err_offload_rule: mlx5_esw_vporttbl_put(esw, &per_vport_tbl_attr); err_default_tbl: + kfree(sample_flow); return ERR_PTR(err); }