diff options
| author | Alex Mastro <amastro@fb.com> | 2025-09-08 08:58:40 -0700 |
|---|---|---|
| committer | Alex Williamson <alex.williamson@redhat.com> | 2025-09-19 14:45:43 -0600 |
| commit | 16df67f2189a71a8310bcebddb87ed569e8352be (patch) | |
| tree | 767cf1891a26abf4958d962e2bdcf57fd70a0c69 | |
| parent | eaba58355ecd124b4a8c91df7335970ad9fe2624 (diff) | |
vfio: return -ENOTTY for unsupported device feature
The two implementers of vfio_device_ops.device_feature,
vfio_cdx_ioctl_feature and vfio_pci_core_ioctl_feature, return
-ENOTTY in the fallthrough case when the feature is unsupported. For
consistency, the base case, vfio_ioctl_device_feature, should do the
same when device_feature == NULL, indicating an implementation has no
feature extensions.
Signed-off-by: Alex Mastro <amastro@fb.com>
Link: https://lore.kernel.org/r/20250908-vfio-enotty-v1-1-4428e1539e2e@fb.com
Signed-off-by: Alex Williamson <alex.williamson@redhat.com>
| -rw-r--r-- | drivers/vfio/vfio_main.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/vfio/vfio_main.c b/drivers/vfio/vfio_main.c index 91a8eae308ea..38c8e9350a60 100644 --- a/drivers/vfio/vfio_main.c +++ b/drivers/vfio/vfio_main.c @@ -1252,7 +1252,7 @@ static int vfio_ioctl_device_feature(struct vfio_device *device, feature.argsz - minsz); default: if (unlikely(!device->ops->device_feature)) - return -EINVAL; + return -ENOTTY; return device->ops->device_feature(device, feature.flags, arg->data, feature.argsz - minsz); |
