You've already forked linux-rockchip
mirror of
https://github.com/armbian/linux-rockchip.git
synced 2026-01-06 11:08:10 -08:00
net/mlx4: Check retval of mlx4_bitmap_init
[ Upstream commit594c61ffc7] 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:d57febe1a4("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> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
da86a63479
commit
a24d5f6c8b
@@ -697,7 +697,8 @@ static int mlx4_create_zones(struct mlx4_dev *dev,
|
||||
err = mlx4_bitmap_init(*bitmap + k, 1,
|
||||
MLX4_QP_TABLE_RAW_ETH_SIZE - 1, 0,
|
||||
0);
|
||||
mlx4_bitmap_alloc_range(*bitmap + k, 1, 1, 0);
|
||||
if (!err)
|
||||
mlx4_bitmap_alloc_range(*bitmap + k, 1, 1, 0);
|
||||
}
|
||||
|
||||
if (err)
|
||||
|
||||
Reference in New Issue
Block a user