Re: [PATCH] vdpa/mlx5: Veirfy wq has a valid pointer in mlx5_vdpa_suspend

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

 



typos all over.

subject:
s/Veirfy/verify/
s/has/is/

On Sun, Mar 26, 2023 at 04:17:56PM +0300, Eli Cohen wrote:
> mlx5_vdpa_suspend() flushes the workqueue as part of its logic. However,
> if the devices has been deleted while a VM was runnig, the workqueue

s/the devices/the device/
s/runnig/running/

> would be destroyed first and wq will be null. After the VM is destroyed,
> suspend could be called and would access a null pointer.

s/could be/can be/
s/would/will/

> 
> Fix it by vrifyig wq is not NULL.

s/vrifyig/verifying/

> 
> Fixes: cae15c2ed8e6 ("vdpa/mlx5: Implement susupend virtqueue callback")
> Signed-off-by: Eli Cohen <elic@xxxxxxxxxx>


> ---
>  drivers/vdpa/mlx5/net/mlx5_vnet.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/vdpa/mlx5/net/mlx5_vnet.c b/drivers/vdpa/mlx5/net/mlx5_vnet.c
> index 8b52961d1d25..2805d58378fb 100644
> --- a/drivers/vdpa/mlx5/net/mlx5_vnet.c
> +++ b/drivers/vdpa/mlx5/net/mlx5_vnet.c
> @@ -2938,7 +2938,8 @@ static int mlx5_vdpa_suspend(struct vdpa_device *vdev)
>  	down_write(&ndev->reslock);
>  	ndev->nb_registered = false;
>  	mlx5_notifier_unregister(mvdev->mdev, &ndev->nb);
> -	flush_workqueue(ndev->mvdev.wq);
> +	if (ndev->mvdev.wq)
> +		flush_workqueue(ndev->mvdev.wq);
>  	for (i = 0; i < ndev->cur_num_vqs; i++) {
>  		mvq = &ndev->vqs[i];
>  		suspend_vq(ndev, mvq);
> -- 
> 2.38.1

_______________________________________________
Virtualization mailing list
Virtualization@xxxxxxxxxxxxxxxxxxxxxxxxxx
https://lists.linuxfoundation.org/mailman/listinfo/virtualization



[Index of Archives]     [KVM Development]     [Libvirt Development]     [Libvirt Users]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]

  Powered by Linux