aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/powerpc/kvm/powerpc.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
index e0fae7a618c..caeed7b31bf 100644
--- a/arch/powerpc/kvm/powerpc.c
+++ b/arch/powerpc/kvm/powerpc.c
@@ -512,15 +512,17 @@ long kvm_arch_vcpu_ioctl(struct file *filp,
512 void __user *argp = (void __user *)arg; 512 void __user *argp = (void __user *)arg;
513 long r; 513 long r;
514 514
515 switch (ioctl) { 515 if (ioctl == KVM_INTERRUPT) {
516 case KVM_INTERRUPT: {
517 struct kvm_interrupt irq; 516 struct kvm_interrupt irq;
518 r = -EFAULT; 517 r = -EFAULT;
519 if (copy_from_user(&irq, argp, sizeof(irq))) 518 if (copy_from_user(&irq, argp, sizeof(irq)))
520 goto out; 519 goto out_nolock;
521 r = kvm_vcpu_ioctl_interrupt(vcpu, &irq); 520 r = kvm_vcpu_ioctl_interrupt(vcpu, &irq);
522 break; 521 goto out_nolock;
523 } 522 }
523
524 vcpu_load(vcpu);
525 switch (ioctl) {
524 case KVM_ENABLE_CAP: 526 case KVM_ENABLE_CAP:
525 { 527 {
526 struct kvm_enable_cap cap; 528 struct kvm_enable_cap cap;
@@ -535,6 +537,8 @@ long kvm_arch_vcpu_ioctl(struct file *filp,
535 } 537 }
536 538
537out: 539out:
540 vcpu_put(vcpu);
541out_nolock:
538 return r; 542 return r;
539} 543}
540 544