]> git.baikalelectronics.ru Git - kernel.git/commit
net/mlx4: Check retval of mlx4_bitmap_init
authorPeter Kosyh <pkosyh@yandex.ru>
Thu, 17 Nov 2022 15:28:06 +0000 (18:28 +0300)
committerJakub Kicinski <kuba@kernel.org>
Sat, 19 Nov 2022 03:34:30 +0000 (19:34 -0800)
commitb8d36a11914c08be454b033e5b960dfcad30cdde
tree558ed9fe599cd961985037d57bf1f9dde12f64cc
parent3cd233549e00163aa7ed9a2ff70db243dbb63c32
net/mlx4: Check retval of mlx4_bitmap_init

If mlx4_bitmap_init fails, mlx4_bitmap_alloc_range will dereference
the NULL pointer (bitmap->table).

Make sure, that mlx4_bitmap_alloc_range called in no error case.

Found by Linux Verification Center (linuxtesting.org) with SVACE.

Fixes: 08e1283e04dc ("net/mlx4: Add A0 hybrid steering")
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Signed-off-by: Peter Kosyh <pkosyh@yandex.ru>
Link: https://lore.kernel.org/r/20221117152806.278072-1-pkosyh@yandex.ru
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/mellanox/mlx4/qp.c