aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Elfring <[email protected]>2017-01-19 11:10:26 +0100
committerJames Hogan <[email protected]>2017-02-02 14:10:16 +0000
commit5a6da5f78431f6b172078eb5bd524187833f360b (patch)
tree3ea4fc04487d29bd14208b19b1d2ca2db63ecefc
parent0b4c208d443ba2af82b4c70f99ca8df31e9a0020 (diff)
MIPS: KVM: Return directly after a failed copy_from_user() in kvm_arch_vcpu_ioctl()
* Return directly after a call of the function "copy_from_user" failed in a case block. * Delete the jump label "out" which became unnecessary with this refactoring. Signed-off-by: Markus Elfring <[email protected]> Reviewed-by: Paolo Bonzini <[email protected]> Signed-off-by: James Hogan <[email protected]>
-rw-r--r--arch/mips/kvm/mips.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/arch/mips/kvm/mips.c b/arch/mips/kvm/mips.c
index 29ec9ab3fd55..7999ef4d1147 100644
--- a/arch/mips/kvm/mips.c
+++ b/arch/mips/kvm/mips.c
@@ -1152,10 +1152,8 @@ long kvm_arch_vcpu_ioctl(struct file *filp, unsigned int ioctl,
{
struct kvm_mips_interrupt irq;
- r = -EFAULT;
if (copy_from_user(&irq, argp, sizeof(irq)))
- goto out;
-
+ return -EFAULT;
kvm_debug("[%d] %s: irq: %d\n", vcpu->vcpu_id, __func__,
irq.irq);
@@ -1165,17 +1163,14 @@ long kvm_arch_vcpu_ioctl(struct file *filp, unsigned int ioctl,
case KVM_ENABLE_CAP: {
struct kvm_enable_cap cap;
- r = -EFAULT;
if (copy_from_user(&cap, argp, sizeof(cap)))
- goto out;
+ return -EFAULT;
r = kvm_vcpu_ioctl_enable_cap(vcpu, &cap);
break;
}
default:
r = -ENOIOCTLCMD;
}
-
-out:
return r;
}