KVM: fix the errno of ioctl KVM_[UN]REGISTER_COALESCED_MMIO failure
[pandora-kernel.git] / virt / kvm / coalesced_mmio.c
index 5169736..b66001f 100644 (file)
@@ -10,6 +10,7 @@
 #include "iodev.h"
 
 #include <linux/kvm_host.h>
+#include <linux/slab.h>
 #include <linux/kvm.h>
 
 #include "coalesced_mmio.h"
@@ -138,7 +139,7 @@ int kvm_vm_ioctl_register_coalesced_mmio(struct kvm *kvm,
        struct kvm_coalesced_mmio_dev *dev = kvm->coalesced_mmio_dev;
 
        if (dev == NULL)
-               return -EINVAL;
+               return -ENXIO;
 
        mutex_lock(&kvm->slots_lock);
        if (dev->nb_zones >= KVM_COALESCED_MMIO_ZONE_MAX) {
@@ -161,7 +162,7 @@ int kvm_vm_ioctl_unregister_coalesced_mmio(struct kvm *kvm,
        struct kvm_coalesced_mmio_zone *z;
 
        if (dev == NULL)
-               return -EINVAL;
+               return -ENXIO;
 
        mutex_lock(&kvm->slots_lock);