diff mbox series

vfio/mlx5: Fix to not use 0 as NULL pointer

Message ID 20220309080217.94274-1-yishaih@nvidia.com (mailing list archive)
State New, archived
Headers show
Series vfio/mlx5: Fix to not use 0 as NULL pointer | expand

Commit Message

Yishai Hadas March 9, 2022, 8:02 a.m. UTC
Fix sparse warning to not use plain integer (i.e. 0) as NULL pointer.

Reported-by: kernel test robot <lkp@intel.com>
Fixes: 6fadb021266d ("vfio/mlx5: Implement vfio_pci driver for mlx5 devices")
Signed-off-by: Yishai Hadas <yishaih@nvidia.com>
---
 drivers/vfio/pci/mlx5/main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Alex Williamson March 9, 2022, 5:34 p.m. UTC | #1
On Wed, 9 Mar 2022 10:02:17 +0200
Yishai Hadas <yishaih@nvidia.com> wrote:

> Fix sparse warning to not use plain integer (i.e. 0) as NULL pointer.
> 
> Reported-by: kernel test robot <lkp@intel.com>
> Fixes: 6fadb021266d ("vfio/mlx5: Implement vfio_pci driver for mlx5 devices")
> Signed-off-by: Yishai Hadas <yishaih@nvidia.com>
> ---
>  drivers/vfio/pci/mlx5/main.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/vfio/pci/mlx5/main.c b/drivers/vfio/pci/mlx5/main.c
> index 282a9d4bf776..bbec5d288fee 100644
> --- a/drivers/vfio/pci/mlx5/main.c
> +++ b/drivers/vfio/pci/mlx5/main.c
> @@ -409,7 +409,7 @@ mlx5vf_pci_step_device_state_locked(struct mlx5vf_pci_core_device *mvdev,
>  
>  	if ((cur == VFIO_DEVICE_STATE_STOP_COPY && new == VFIO_DEVICE_STATE_STOP)) {
>  		mlx5vf_disable_fds(mvdev);
> -		return 0;
> +		return NULL;
>  	}
>  
>  	if (cur == VFIO_DEVICE_STATE_STOP && new == VFIO_DEVICE_STATE_RESUMING) {
> @@ -430,7 +430,7 @@ mlx5vf_pci_step_device_state_locked(struct mlx5vf_pci_core_device *mvdev,
>  		if (ret)
>  			return ERR_PTR(ret);
>  		mlx5vf_disable_fds(mvdev);
> -		return 0;
> +		return NULL;
>  	}
>  
>  	/*

Applied to vfio next branch for v5.18.  Thanks,

Alex
diff mbox series

Patch

diff --git a/drivers/vfio/pci/mlx5/main.c b/drivers/vfio/pci/mlx5/main.c
index 282a9d4bf776..bbec5d288fee 100644
--- a/drivers/vfio/pci/mlx5/main.c
+++ b/drivers/vfio/pci/mlx5/main.c
@@ -409,7 +409,7 @@  mlx5vf_pci_step_device_state_locked(struct mlx5vf_pci_core_device *mvdev,
 
 	if ((cur == VFIO_DEVICE_STATE_STOP_COPY && new == VFIO_DEVICE_STATE_STOP)) {
 		mlx5vf_disable_fds(mvdev);
-		return 0;
+		return NULL;
 	}
 
 	if (cur == VFIO_DEVICE_STATE_STOP && new == VFIO_DEVICE_STATE_RESUMING) {
@@ -430,7 +430,7 @@  mlx5vf_pci_step_device_state_locked(struct mlx5vf_pci_core_device *mvdev,
 		if (ret)
 			return ERR_PTR(ret);
 		mlx5vf_disable_fds(mvdev);
-		return 0;
+		return NULL;
 	}
 
 	/*