Skip to contentSkip to conversation

KVM: ia64: fix the error of ioctl KVM_IRQ_LINE if no irq chip

PATCH New Wei Yongjun 1 participant 1 message Mar 12, 2010 KVM

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 KVM: ia64: fix the error of ioctl KVM_IRQ_LINE if no irq chip

If no irq chip in kernel, ioctl KVM_IRQ_LINE will return -EFAULT. But I see in other place such as KVM_[GET|SET]IRQCHIP, -ENXIO is return. So this patch used -ENXIO instead of -EFAULT.

---
 arch/ia64/kvm/kvm-ia64.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
arch/ia64/kvm/kvm-ia64.c +2 -0
index 26e0e08..0d2e41a 100644
@@ -979,11 +979,13 @@ long kvm_arch_vm_ioctl(struct file *filp,
 		r = -EFAULT;
 		if (copy_from_user(&irq_event, argp, sizeof irq_event))
 			goto out;
+		r = -ENXIO;
 		if (irqchip_in_kernel(kvm)) {
 			__s32 status;
 			status = kvm_set_irq(kvm, KVM_USERSPACE_IRQ_SOURCE_ID,
 				    irq_event.irq, irq_event.level);
 			if (ioctl == KVM_IRQ_LINE_STATUS) {
+				r = -EFAULT;
 				irq_event.status = status;
 				if (copy_to_user(argp, &irq_event,
 							sizeof irq_event))
Signature · 1 line
1.6.3.3