summaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/x86.c
diff options
context:
space:
mode:
authorGuo Chao2012-11-02 11:33:22 +0100
committerMarcelo Tosatti2012-11-14 01:14:29 +0100
commit951179ce86f5599e2dfb9de254056e91bd865f15 (patch)
tree7a1b76ee21eff48b8d759a7c06f54e2444d37fd7 /arch/x86/kvm/x86.c
parentKVM: do not kfree error pointer (diff)
downloadkernel-qcow2-linux-951179ce86f5599e2dfb9de254056e91bd865f15.tar.gz
kernel-qcow2-linux-951179ce86f5599e2dfb9de254056e91bd865f15.tar.xz
kernel-qcow2-linux-951179ce86f5599e2dfb9de254056e91bd865f15.zip
KVM: x86: fix return value of kvm_vm_ioctl_set_tss_addr()
Return value of this function will be that of ioctl(). #include <stdio.h> #include <linux/kvm.h> int main () { int fd; fd = open ("/dev/kvm", 0); fd = ioctl (fd, KVM_CREATE_VM, 0); ioctl (fd, KVM_SET_TSS_ADDR, 0xfffff000); perror (""); return 0; } Output is "Operation not permitted". That's not what we want. Return -EINVAL in this case. Signed-off-by: Guo Chao <yan@linux.vnet.ibm.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/x86/kvm/x86.c')
-rw-r--r--arch/x86/kvm/x86.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 40905ce6be0a..a25b3df8e3e1 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -2946,7 +2946,7 @@ static int kvm_vm_ioctl_set_tss_addr(struct kvm *kvm, unsigned long addr)
int ret;
if (addr > (unsigned int)(-3 * PAGE_SIZE))
- return -1;
+ return -EINVAL;
ret = kvm_x86_ops->set_tss_addr(kvm, addr);
return ret;
}