]> git.ipfire.org Git - thirdparty/kernel/stable.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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 8 Dec 2022 10:15:39 +0000 (11:15 +0100)
commitbfb211fe095b8ab1c1a088ff0063a717c6223174
treeb5c3169cf786cf3bd3023964c2275854ed9ee4e2
parente5c87ee95d96fbd1af60e7e5ac2a789524bbc95a
net/mlx4: Check retval of mlx4_bitmap_init

[ Upstream commit 594c61ffc77de0a197934aa0f1df9285c68801c6 ]

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: d57febe1a478 ("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>
drivers/net/ethernet/mellanox/mlx4/qp.c