Return the actual error code from vfio_set_irqs_validate_and_prepare() instead of always collapsing to -EINVAL. While the helper currently returns -EINVAL in most cases, passing through the real error code is more future-proof.
While at it, drop the stray 'intel:' prefix from the error message. Signed-off-by: Andi Shyti <[email protected]> Reviewed-by: Zhenyu Wang <[email protected]> Link: https://lore.kernel.org/r/[email protected] --- Hi, I'm resending the patch because the first version had some dependencies that CI didn't build yet. In the meantime I'm updating the tag section. Thanks Zhenyu for your review. Andi v1-v2: Add Zhenyu's r-b drivers/gpu/drm/i915/gvt/kvmgt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/gvt/kvmgt.c b/drivers/gpu/drm/i915/gvt/kvmgt.c index 183128b84630..c43b47687838 100644 --- a/drivers/gpu/drm/i915/gvt/kvmgt.c +++ b/drivers/gpu/drm/i915/gvt/kvmgt.c @@ -1369,8 +1369,8 @@ static long intel_vgpu_ioctl(struct vfio_device *vfio_dev, unsigned int cmd, ret = vfio_set_irqs_validate_and_prepare(&hdr, max, VFIO_PCI_NUM_IRQS, &data_size); if (ret) { - gvt_vgpu_err("intel:vfio_set_irqs_validate_and_prepare failed\n"); - return -EINVAL; + gvt_vgpu_err("vfio_set_irqs_validate_and_prepare failed\n"); + return ret; } data = memdup_user((void __user *)(arg + minsz), -- 2.47.2
