Skip to content

Commit 16df67f

Browse files
Alex MastroAlex Williamson
authored andcommitted
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>
1 parent eaba583 commit 16df67f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/vfio/vfio_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1252,7 +1252,7 @@ static int vfio_ioctl_device_feature(struct vfio_device *device,
12521252
feature.argsz - minsz);
12531253
default:
12541254
if (unlikely(!device->ops->device_feature))
1255-
return -EINVAL;
1255+
return -ENOTTY;
12561256
return device->ops->device_feature(device, feature.flags,
12571257
arg->data,
12581258
feature.argsz - minsz);

0 commit comments

Comments
 (0)