Re: [PATCH -next v2] net/mlx5: Devcom, only use devcom after NULL check in mlx5_devcom_send_event()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Aug 14, 2023 at 03:23:42PM +0800, Li Zetao wrote:
> There is a warning reported by kernel test robot:
> 
> smatch warnings:
> drivers/net/ethernet/mellanox/mlx5/core/lib/devcom.c:264
> 	mlx5_devcom_send_event() warn: variable dereferenced before
> 		IS_ERR check devcom (see line 259)
> 
> The reason for the warning is that the pointer is used before check, put
> the assignment to comp after devcom check to silence the warning.
> 
> Fixes: 88d162b47981 ("net/mlx5: Devcom, Infrastructure changes")
> Reported-by: kernel test robot <lkp@xxxxxxxxx>
> Reported-by: Dan Carpenter <error27@xxxxxxxxx>
> Closes: https://lore.kernel.org/r/202308041028.AkXYDwJ6-lkp@xxxxxxxxx/
> Signed-off-by: Li Zetao <lizetao1@xxxxxxxxxx>
> ---
> v1 -> v2: Modify the order of variable declarations to end up with reverse x-mas tree order.
> v1: https://lore.kernel.org/all/20230804092636.91357-1-lizetao1@xxxxxxxxxx/
> 
>  drivers/net/ethernet/mellanox/mlx5/core/lib/devcom.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 

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



[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux