提交 5c0d0920 编写于 作者: W Wei Yongjun 提交者: Avi Kivity

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: NWei Yongjun <yjwei@cn.fujitsu.com>
Signed-off-by: NMarcelo Tosatti <mtosatti@redhat.com>
上级 ec68798c
...@@ -1535,8 +1535,10 @@ long kvm_arch_vcpu_ioctl(struct file *filp, ...@@ -1535,8 +1535,10 @@ long kvm_arch_vcpu_ioctl(struct file *filp,
goto out; goto out;
if (copy_to_user(user_stack, stack, if (copy_to_user(user_stack, stack,
sizeof(struct kvm_ia64_vcpu_stack))) sizeof(struct kvm_ia64_vcpu_stack))) {
r = -EFAULT;
goto out; goto out;
}
break; break;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册