Skip to content

Commit a002602

Browse files
ddvladkuba-moo
authored andcommitted
net/mlx5: HWS, Init mutex on the correct path
The newly introduced mutex is only used for reformat actions, but it was initialized for modify header instead. The struct that contains the mutex is zero-initialized and an all-zero mutex is valid, so the issue only shows up with CONFIG_DEBUG_MUTEXES. Fixes: b206d9e ("net/mlx5: HWS, register reformat actions with fw") Signed-off-by: Vlad Dogaru <[email protected]> Reviewed-by: Yevgeny Kliteynik <[email protected]> Signed-off-by: Mark Bloch <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 8ec40e3 commit a002602

File tree

1 file changed

+1
-1
lines changed
  • drivers/net/ethernet/mellanox/mlx5/core/steering/hws

1 file changed

+1
-1
lines changed

drivers/net/ethernet/mellanox/mlx5/core/steering/hws/fs_hws.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1357,6 +1357,7 @@ mlx5_cmd_hws_packet_reformat_alloc(struct mlx5_flow_root_namespace *ns,
13571357
pkt_reformat->fs_hws_action.pr_data = pr_data;
13581358
}
13591359

1360+
mutex_init(&pkt_reformat->fs_hws_action.lock);
13601361
pkt_reformat->owner = MLX5_FLOW_RESOURCE_OWNER_HWS;
13611362
pkt_reformat->fs_hws_action.hws_action = hws_action;
13621363
return 0;
@@ -1503,7 +1504,6 @@ static int mlx5_cmd_hws_modify_header_alloc(struct mlx5_flow_root_namespace *ns,
15031504
err = -ENOMEM;
15041505
goto release_mh;
15051506
}
1506-
mutex_init(&modify_hdr->fs_hws_action.lock);
15071507
modify_hdr->fs_hws_action.mh_data = mh_data;
15081508
modify_hdr->fs_hws_action.fs_pool = pool;
15091509
modify_hdr->owner = MLX5_FLOW_RESOURCE_OWNER_SW;

0 commit comments

Comments
 (0)