Commit 312b0efe authored by YueHaibing's avatar YueHaibing Committed by sanglipeng
Browse files

net/mlx5: Fix uninitialized variable bug in outlen_write()

stable inclusion
from stable-v5.10.158
commit 2cb84ff34938cc3cdfe2d90e70cf8a8ced66fd1e
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I7NTXH

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



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

[ Upstream commit 3f5769a0 ]

If sscanf() return 0, outlen is uninitialized and used in kzalloc(),
this is unexpected. We should return -EINVAL if the string is invalid.

Fixes: e126ba97 ("mlx5: Add driver for Mellanox Connect-IB adapters")
Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
Reviewed-by: default avatarLeon Romanovsky <leonro@nvidia.com>
Signed-off-by: default avatarSaeed Mahameed <saeedm@nvidia.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarsanglipeng <sanglipeng1@jd.com>
parent f9f41643
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment