Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net/mlx5: fs, fix RDMA TRANSPORT init cleanup flow

Failing during the initialization of root_namespace didn't cleanup
the priorities of the namespace on which the failure occurred.

Properly cleanup said priorities on failure.

Fixes: 52931f55159e ("net/mlx5: fs, add multiple prios to RDMA TRANSPORT steering domain")
Signed-off-by: Patrisious Haddad <phaddad@nvidia.com>
Link: https://patch.msgid.link/78cf89b5d8452caf1e979350b30ada6904362f66.1751451780.git.leon@kernel.org
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Leon Romanovsky <leon@kernel.org>

authored by

Patrisious Haddad and committed by
Leon Romanovsky
02943ac2 1f6da566

+18 -4
+18 -4
drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
··· 3247 3247 { 3248 3248 struct mlx5_flow_root_namespace *root_ns; 3249 3249 struct fs_prio *prio; 3250 + int ret; 3250 3251 int i; 3251 3252 3252 3253 steering->rdma_transport_rx_root_ns[vport_idx] = ··· 3259 3258 3260 3259 for (i = 0; i < MLX5_RDMA_TRANSPORT_BYPASS_PRIO; i++) { 3261 3260 prio = fs_create_prio(&root_ns->ns, i, 1); 3262 - if (IS_ERR(prio)) 3263 - return PTR_ERR(prio); 3261 + if (IS_ERR(prio)) { 3262 + ret = PTR_ERR(prio); 3263 + goto err; 3264 + } 3264 3265 } 3265 3266 set_prio_attrs(root_ns); 3266 3267 return 0; 3268 + 3269 + err: 3270 + cleanup_root_ns(root_ns); 3271 + return ret; 3267 3272 } 3268 3273 3269 3274 static int ··· 3278 3271 { 3279 3272 struct mlx5_flow_root_namespace *root_ns; 3280 3273 struct fs_prio *prio; 3274 + int ret; 3281 3275 int i; 3282 3276 3283 3277 steering->rdma_transport_tx_root_ns[vport_idx] = ··· 3290 3282 3291 3283 for (i = 0; i < MLX5_RDMA_TRANSPORT_BYPASS_PRIO; i++) { 3292 3284 prio = fs_create_prio(&root_ns->ns, i, 1); 3293 - if (IS_ERR(prio)) 3294 - return PTR_ERR(prio); 3285 + if (IS_ERR(prio)) { 3286 + ret = PTR_ERR(prio); 3287 + goto err; 3288 + } 3295 3289 } 3296 3290 set_prio_attrs(root_ns); 3297 3291 return 0; 3292 + 3293 + err: 3294 + cleanup_root_ns(root_ns); 3295 + return ret; 3298 3296 } 3299 3297 3300 3298 static int init_rdma_transport_rx_root_ns(struct mlx5_flow_steering *steering)