]> 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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 8 Dec 2022 10:22:58 +0000 (11:22 +0100)
commit0f5f62a2879be8f47c6143408cee5b416e536a7e
tree7c06e0356afe2a5b3865b138d2fe94894824a407
parent4767001585919adff4625c2006ef1a2ad66e97aa
net/mlx4: Check retval of mlx4_bitmap_init

[ Upstream commit 9c13d01269a6db2e9873d0c7442f7db0660f6cc7 ]

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: cc7286abba8b ("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