summaryrefslogtreecommitdiffstats
path: root/drivers/vfio
diff options
context:
space:
mode:
authorYishai Hadas <yishaih@nvidia.com>2022-03-09 10:02:17 +0200
committerAlex Williamson <alex.williamson@redhat.com>2022-03-09 10:29:40 -0700
commit5b26f2c249b1034ab327dd29e73fec078d0ece18 (patch)
tree1fddd8a0ead7c8278a84f5073befe19d93f059c0 /drivers/vfio
parent8d26c4328b468e449df21314ef993eeaefc0306f (diff)
downloadlinux-5b26f2c249b1034ab327dd29e73fec078d0ece18.tar.bz2
vfio/mlx5: Fix to not use 0 as NULL pointer
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> Link: https://lore.kernel.org/r/202203090703.kxvZumJg-lkp@intel.com Link: https://lore.kernel.org/r/20220309080217.94274-1-yishaih@nvidia.com Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
Diffstat (limited to 'drivers/vfio')
-rw-r--r--drivers/vfio/pci/mlx5/main.c4
1 files 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;
}
/*