提交 5b26f2c2 编写于 作者: Y Yishai Hadas 提交者: Alex Williamson

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: Nkernel test robot <lkp@intel.com>
Fixes: 6fadb021 ("vfio/mlx5: Implement vfio_pci driver for mlx5 devices")
Signed-off-by: NYishai 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.comSigned-off-by: NAlex Williamson <alex.williamson@redhat.com>
上级 8d26c432
...@@ -409,7 +409,7 @@ mlx5vf_pci_step_device_state_locked(struct mlx5vf_pci_core_device *mvdev, ...@@ -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)) { if ((cur == VFIO_DEVICE_STATE_STOP_COPY && new == VFIO_DEVICE_STATE_STOP)) {
mlx5vf_disable_fds(mvdev); mlx5vf_disable_fds(mvdev);
return 0; return NULL;
} }
if (cur == VFIO_DEVICE_STATE_STOP && new == VFIO_DEVICE_STATE_RESUMING) { 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, ...@@ -430,7 +430,7 @@ mlx5vf_pci_step_device_state_locked(struct mlx5vf_pci_core_device *mvdev,
if (ret) if (ret)
return ERR_PTR(ret); return ERR_PTR(ret);
mlx5vf_disable_fds(mvdev); mlx5vf_disable_fds(mvdev);
return 0; return NULL;
} }
/* /*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册