Re: [PATCH net] net/mlx5: Fix uninitialized variable bug in outlen_write()

From: Leon Romanovsky
Date: Tue Nov 22 2022 - 08:06:46 EST


On Mon, Nov 21, 2022 at 07:22:04PM +0800, YueHaibing wrote:
> If sscanf() return 0, outlen is uninitialized and used in kzalloc(),
> this is unexpected. We should return -EINVAL if the string is invalid.
>
> Fixes: e126ba97dba9 ("mlx5: Add driver for Mellanox Connect-IB adapters")
> Signed-off-by: YueHaibing <yuehaibing@xxxxxxxxxx>
> ---
> drivers/net/ethernet/mellanox/mlx5/core/cmd.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>

Thanks,
Reviewed-by: Leon Romanovsky <leonro@xxxxxxxxxx>