]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net/mlx5: Check for invalid vector index on EQ creation
authorMaher Sanalla <msanalla@nvidia.com>
Tue, 15 Oct 2024 09:32:05 +0000 (12:32 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 1 Nov 2024 01:02:31 +0000 (02:02 +0100)
commit863c7f4187443fcfedadeab5554a024b679049d7
treec8a374f793f9b63d0d4ee52e5df05751c11e3cc8
parent68cd084e3ec1512cd383cb3e9cf0ab7ab413724c
net/mlx5: Check for invalid vector index on EQ creation

[ Upstream commit d4f25be27e3ef7e23998fbd3dd4bff0602de7ae5 ]

Currently, mlx5 driver does not enforce vector index to be lower than
the maximum number of supported completion vectors when requesting a
new completion EQ. Thus, mlx5_comp_eqn_get() fails when trying to
acquire an IRQ with an improper vector index.

To prevent the case above, enforce that vector index value is
valid and lower than maximum in mlx5_comp_eqn_get() before handling the
request.

Fixes: f14c1a14e632 ("net/mlx5: Allocate completion EQs dynamically")
Signed-off-by: Maher Sanalla <msanalla@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/eq.c