]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx5: Add MLX5_FLEXIBLE_INLEN to safely calculate cmd inlen
authorMaxim Mikityanskiy <maximmi@nvidia.com>
Thu, 29 Sep 2022 07:21:45 +0000 (00:21 -0700)
committerJakub Kicinski <kuba@kernel.org>
Fri, 30 Sep 2022 14:55:46 +0000 (07:55 -0700)
commit0aceda1d0baa1af88e9ee70dc157f61b665f9d3e
tree164de7a8a61e5073df3e992fa2dbc81505b9b0cd
parent109d1b134e3d8e45fe398f3a25aa33899ba79c26
net/mlx5: Add MLX5_FLEXIBLE_INLEN to safely calculate cmd inlen

Some commands use a flexible array after a common header. Add a macro to
safely calculate the total input length of the command, detecting
overflows and printing errors with specific values when such overflows
happen.

Signed-off-by: Maxim Mikityanskiy <maximmi@nvidia.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlx5/core/mlx5_core.h