🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.netdev
1 messages
1 total messages Started by Wanhui Fu Thu, 26 Nov 2026 13:22
[PATCH] net/mlx5: Free the table after storing failure in mlx5dr_domain_get_recalc_cs_ft_addr()
#23083
Author: Wanhui Fu
Date: Thu, 26 Nov 2026 13:22
31 lines
9340 bytes
If xa_store() fails, the entry recalc_cs_ft has not been stored in
XArray. Therefore dr_domain_uninit_csum_recalc_fts() would not destroy
this entry. Just call mlx5dr_fw_destroy_recalc_cs_ft if xa_store() fails.

Found it by a self-developed static analysis tool and compile-test passed.

Fixes: c0e90fc2ccaa ("net/mlx5: DR, Support csum recalculation flow table on SFs")
Signed-off-by: Wanhui Fu <fuwh1120@163.com>
---
 .../net/ethernet/mellanox/mlx5/core/steering/sws/dr_domain.c  | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_domain.c b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_domain.c
index fedefb565a21..3747c217b61c 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_domain.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/steering/sws/dr_domain.c
@@ -87,8 +87,10 @@ int mlx5dr_domain_get_recalc_cs_ft_addr(struct mlx5dr_domain *dmn,
 
 		ret = xa_err(xa_store(&dmn->csum_fts_xa, vport_num,
 				      recalc_cs_ft, GFP_KERNEL));
-		if (ret)
+		if (ret) {
+			mlx5dr_fw_destroy_recalc_cs_ft(dmn, recalc_cs_ft);
 			return ret;
+		}
 	}
 
 	*rx_icm_addr = recalc_cs_ft->rx_icm_addr;
-- 
2.25.1
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads