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: NYueHaibing <yuehaibing@huawei.com> Reviewed-by: NLeon Romanovsky <leonro@nvidia.com> Signed-off-by: NSaeed Mahameed <saeedm@nvidia.com> Signed-off-by: NSasha Levin <sashal@kernel.org> Signed-off-by: Nsanglipeng <sanglipeng1@jd.com>
Showing
想要评论请 注册 或 登录