]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
vfio: Require drivers to implement get_region_info
authorJason Gunthorpe <jgg@nvidia.com>
Fri, 7 Nov 2025 17:41:30 +0000 (13:41 -0400)
committerAlex Williamson <alex@shazbot.org>
Wed, 12 Nov 2025 22:05:02 +0000 (15:05 -0700)
Remove the fallback through the ioctl callback, no drivers use this now.

Reviewed-by: Kevin Tian <kevin.tian@intel.com>
Reviewed-by: Pranjal Shrivastava <praan@google.com>
Reviewed-by: Mostafa Saleh <smostafa@google.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Link: https://lore.kernel.org/r/14-v2-2a9e24d62f1b+e10a-vfio_get_region_info_op_jgg@nvidia.com
Signed-off-by: Alex Williamson <alex@shazbot.org>
drivers/vfio/vfio_main.c

index a390163ce706c44d097ab7ac596bfad7e8c6af7c..f056e82ba35075e8209b5fb711ddb94b8bdb2b2c 100644 (file)
@@ -1297,13 +1297,13 @@ static long vfio_device_fops_unl_ioctl(struct file *filep,
                break;
 
        case VFIO_DEVICE_GET_REGION_INFO:
-               if (!device->ops->get_region_info)
-                       goto ioctl_fallback;
-               ret = device->ops->get_region_info(device, uptr);
+               if (unlikely(!device->ops->get_region_info))
+                       ret = -EINVAL;
+               else
+                       ret = device->ops->get_region_info(device, uptr);
                break;
 
        default:
-ioctl_fallback:
                if (unlikely(!device->ops->ioctl))
                        ret = -EINVAL;
                else