Commit 5304c0cb authored by Peter Kosyh's avatar Peter Kosyh Committed by sanglipeng
Browse files

net/mlx4: Check retval of mlx4_bitmap_init

stable inclusion
from stable-v5.10.157
commit a24d5f6c8b7bf0f1551573e45dfeb1958d852a91
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I7MU59

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=a24d5f6c8b7bf0f1551573e45dfeb1958d852a91



--------------------------------

[ Upstream commit 594c61ff ]

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: d57febe1 ("net/mlx4: Add A0 hybrid steering")
Reviewed-by: default avatarTariq Toukan <tariqt@nvidia.com>
Signed-off-by: default avatarPeter Kosyh <pkosyh@yandex.ru>
Link: https://lore.kernel.org/r/20221117152806.278072-1-pkosyh@yandex.ru


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarsanglipeng <sanglipeng1@jd.com>
parent fc3fa39c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment