From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BED7519DFAB; Wed, 4 Feb 2026 15:00:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770217257; cv=none; b=eIa/8MelP+YZAbpU3nITlkLXF3Rm8ijHbGjHNtJaKmofMDozoZ/nA3Dtw22U9tdMsfFyC9yod7UZzRK2GyM8lIyrBaMBxXWVAJeWhBlX6hkIpFpshHGmZSw5ShQwagxOAoz2gAuWxRYch95BL2JWjiWnhdKiY9RdBEXC3AMHbL8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770217257; c=relaxed/simple; bh=5sO7eTOAvD4yPSeqtFxmVT23lLbcSC87IOY5lpNCeUc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HFN3yTp0YDDtU/8qnEVR3keCi4PxRQ8v/oWBBGlUrkjRAQsosnCFd1FciWZNaSY4tD+NupYksV91eQXAsLTmed4TOtFqgcwSFAlOSwacBh0+Fv1nHvvVgXsu/zZq5WMJAsTK3Q8c0Im6kUD2BCKr4q232+qJpgTCg7XtpJzXDdk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=2JFUiS3o; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="2JFUiS3o" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 49DEAC4CEF7; Wed, 4 Feb 2026 15:00:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1770217257; bh=5sO7eTOAvD4yPSeqtFxmVT23lLbcSC87IOY5lpNCeUc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2JFUiS3ocpHt3sqCzTNWJ4OfxDc0zQ6VjybV/ZCrtT57uDiB7G50PZ1dPQ3sf5h+A kexmMKVvCsnwcBXD85vI0NlazAg2FtiVhlb5Q55wx548gfKnQZm0QHbtHGIChPvbB4 ajLmXJw2P4bdynrFuQpyLZ5cmMZfPY/pcWWpxmhY= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Zilin Guan , Tariq Toukan , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.15 136/206] net/mlx5: Fix memory leak in esw_acl_ingress_lgcy_setup() Date: Wed, 4 Feb 2026 15:39:27 +0100 Message-ID: <20260204143903.105148892@linuxfoundation.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260204143858.193781818@linuxfoundation.org> References: <20260204143858.193781818@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Zilin Guan [ Upstream commit 108948f723b13874b7ebf6b3f1cc598a7de38622 ] In esw_acl_ingress_lgcy_setup(), if esw_acl_table_create() fails, the function returns directly without releasing the previously created counter, leading to a memory leak. Fix this by jumping to the out label instead of returning directly, which aligns with the error handling logic of other paths in this function. Compile tested only. Issue found using a prototype static analysis tool and code review. Fixes: 07bab9502641 ("net/mlx5: E-Switch, Refactor eswitch ingress acl codes") Signed-off-by: Zilin Guan Reviewed-by: Tariq Toukan Link: https://patch.msgid.link/20260120134640.2717808-1-zilin@seu.edu.cn Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- drivers/net/ethernet/mellanox/mlx5/core/esw/acl/ingress_lgcy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx5/core/esw/acl/ingress_lgcy.c b/drivers/net/ethernet/mellanox/mlx5/core/esw/acl/ingress_lgcy.c index 093ed86a0acd8..db51c500ed359 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/esw/acl/ingress_lgcy.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/esw/acl/ingress_lgcy.c @@ -188,7 +188,7 @@ int esw_acl_ingress_lgcy_setup(struct mlx5_eswitch *esw, if (IS_ERR(vport->ingress.acl)) { err = PTR_ERR(vport->ingress.acl); vport->ingress.acl = NULL; - return err; + goto out; } err = esw_acl_ingress_lgcy_groups_create(esw, vport); -- 2.51.0