vfio: Test kvm pointer in _vfio_device_get_kvm_safe()
authorYi Liu <yi.l.liu@intel.com>
Tue, 18 Jul 2023 13:55:44 +0000 (06:55 -0700)
committerAlex Williamson <alex.williamson@redhat.com>
Tue, 25 Jul 2023 16:19:45 +0000 (10:19 -0600)
commit5c6de3ea73768d1781024e4a41f77d6d71bc64cb
treec4ce32ecd51c449bce1579818ede6b620b295e16
parent8b6f173a4ce47ef0606124710315560c64f2344e
vfio: Test kvm pointer in _vfio_device_get_kvm_safe()

This saves some lines when adding the kvm get logic for the vfio_device
cdev path.

This also renames _vfio_device_get_kvm_safe() to be vfio_device_get_kvm_safe().

Suggested-by: Jason Gunthorpe <jgg@nvidia.com>
Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
Tested-by: Zhenzhong Duan <zhenzhong.duan@intel.com>
Tested-by: Yanting Jiang <yanting.jiang@intel.com>
Signed-off-by: Yi Liu <yi.l.liu@intel.com>
Link: https://lore.kernel.org/r/20230718135551.6592-20-yi.l.liu@intel.com
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
drivers/vfio/group.c
drivers/vfio/vfio.h
drivers/vfio/vfio_main.c