summaryrefslogtreecommitdiffstats
path: root/arch/ia64
diff options
context:
space:
mode:
authorWei Yongjun <yjwei@cn.fujitsu.com>2010-03-12 08:45:39 +0800
committerAvi Kivity <avi@redhat.com>2010-05-17 12:15:30 +0300
commit5c0d0920a270b9f2aa20c1cecb162703da32e766 (patch)
tree7494b38a359df05c50fe98d8eed4cd50d8d16866 /arch/ia64
parentec68798c8fd0f01cdbd3f3e1a970e76a644cf08e (diff)
downloadlinux-5c0d0920a270b9f2aa20c1cecb162703da32e766.tar.gz
linux-5c0d0920a270b9f2aa20c1cecb162703da32e766.tar.bz2
linux-5c0d0920a270b9f2aa20c1cecb162703da32e766.zip
KVM: ia64: fix the error code of ioctl KVM_IA64_VCPU_GET_STACK failure
The ioctl KVM_IA64_VCPU_GET_STACK does not set the error code if copy_to_user() fail, and 0 will be return, we should use -EFAULT instead of 0 in this case, so this patch fixed it. Signed-off-by: Wei Yongjun <yjwei@cn.fujitsu.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/ia64')
-rw-r--r--arch/ia64/kvm/kvm-ia64.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/ia64/kvm/kvm-ia64.c b/arch/ia64/kvm/kvm-ia64.c
index 7f3c0a2e60cd..38d51302f5b3 100644
--- a/arch/ia64/kvm/kvm-ia64.c
+++ b/arch/ia64/kvm/kvm-ia64.c
@@ -1535,8 +1535,10 @@ long kvm_arch_vcpu_ioctl(struct file *filp,
goto out;
if (copy_to_user(user_stack, stack,
- sizeof(struct kvm_ia64_vcpu_stack)))
+ sizeof(struct kvm_ia64_vcpu_stack))) {
+ r = -EFAULT;
goto out;
+ }
break;
}