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: handle errors in mlx5_chains_create_table()

In mlx5_chains_create_table(), the return value of mlx5_get_fdb_sub_ns()
and mlx5_get_flow_namespace() must be checked to prevent NULL pointer
dereferences. If either function fails, the function should log error
message with mlx5_core_warn() and return error pointer.

Fixes: 39ac237ce009 ("net/mlx5: E-Switch, Refactor chains and priorities")
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20250307021820.2646-1-vulab@iscas.ac.cn
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Wentao Liang and committed by
Jakub Kicinski
eab03963 505ead7a

+5
+5
drivers/net/ethernet/mellanox/mlx5/core/lib/fs_chains.c
··· 196 196 ns = mlx5_get_flow_namespace(chains->dev, chains->ns); 197 197 } 198 198 199 + if (!ns) { 200 + mlx5_core_warn(chains->dev, "Failed to get flow namespace\n"); 201 + return ERR_PTR(-EOPNOTSUPP); 202 + } 203 + 199 204 ft_attr.autogroup.num_reserved_entries = 2; 200 205 ft_attr.autogroup.max_num_groups = chains->group_num; 201 206 ft = mlx5_create_auto_grouped_flow_table(ns, &ft_attr);