Re: [PATCH net v2] net/mlx5: handle errors in mlx5_chains_create_table()
From: Tariq Toukan
Date: Thu Mar 06 2025 - 04:19:33 EST
On 06/03/2025 10:54, Wentao Liang wrote:
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.
[v1]->[v2]:
Add Fixes tag.
Target patch to net.
Change return value from NULL to ERR_PTR(-EOPNOTSUPP)
Change history should not be part of the commit message.
Please move it to under the "---" marker below.
Fixes: ae430332557a ("net/mlx5: Refactor multi chains and prios support")
Same problem existed also in mlx5_esw_chains_create_fdb_table(), before
the refactoring.
Please refer to the original patch where issue was introduced, seems to
be commit 39ac237ce009 ("net/mlx5: E-Switch, Refactor chains and
priorities").