]> www.infradead.org Git - users/jedix/linux-maple.git/commit
net/mlx5: Fix io_eq_size and event_eq_size params validation
authorShay Drory <shayd@nvidia.com>
Sun, 18 Dec 2022 10:42:14 +0000 (12:42 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 12 Jan 2023 11:02:10 +0000 (12:02 +0100)
commit95a327eaebe2e8b0e0cdab121c0d798919ec3244
tree07cdb19aedbf1178289edc16b6e1af296c877728
parent3c29ad4f2cc510f5730e5ffbcbb059c5393a0b27
net/mlx5: Fix io_eq_size and event_eq_size params validation

[ Upstream commit 44aee8ea15ac205490a41b00cbafcccbf9f7f82b ]

io_eq_size and event_eq_size params are of param type
DEVLINK_PARAM_TYPE_U32. But, the validation callback is addressing them
as DEVLINK_PARAM_TYPE_U16.

This cause mismatch in validation in big-endian systems, in which
values in range were rejected while 268500991 was accepted.
Fix it by checking the U32 value in the validation callback.

Fixes: 0844fa5f7b89 ("net/mlx5: Let user configure io_eq_size param")
Signed-off-by: Shay Drory <shayd@nvidia.com>
Reviewed-by: Moshe Shemesh <moshe@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/devlink.c