net/mlx5: HWS, handle returned error value in pool alloc
authorVlad Dogaru <vdogaru@nvidia.com>
Thu, 2 Jan 2025 18:14:11 +0000 (20:14 +0200)
committerJakub Kicinski <kuba@kernel.org>
Tue, 7 Jan 2025 00:33:41 +0000 (16:33 -0800)
commita105db854cf2e495caaa17f00ac0321b503def9b
tree2bdf13072988ce34f986d189ffe88a06c94e5d68
parentbe482f1d10da781db9445d2753c1e3f1fd82babf
net/mlx5: HWS, handle returned error value in pool alloc

Handle all negative return values as errors, not just -1.
The code previously treated -ENOMEM (and potentially other negative
values) as valid segment numbers, leading to incorrect behavior.
This fix ensures that any negative return value is treated as an error.

Signed-off-by: Vlad Dogaru <vdogaru@nvidia.com>
Signed-off-by: Yevgeny Kliteynik <kliteyn@nvidia.com>
Reviewed-by: Mark Bloch <mbloch@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/20250102181415.1477316-13-tariqt@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/steering/hws/pool.c