KVM: x86: don't forget vcpu_put() in kvm_arch_vcpu_ioctl_set_sregs()

Due to a bad merge resolution between commit f298103359 ("KVM/x86:
Check input paging mode when cs.l is set") and commit b4ef9d4e8c
("KVM: Move vcpu_load to arch-specific kvm_arch_vcpu_ioctl_set_sregs"),
there is a case in kvm_arch_vcpu_ioctl_set_sregs() where vcpu_put() is
not called after vcpu_get().  Fix it.

Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
This commit is contained in:
Eric Biggers 2017-12-20 16:24:27 -08:00 committed by Radim Krčmář
parent d2b9b2079e
commit 8dbfb2bf1b
1 changed files with 1 additions and 1 deletions

View File

@ -7706,7 +7706,7 @@ int kvm_arch_vcpu_ioctl_set_sregs(struct kvm_vcpu *vcpu,
goto out;
if (kvm_valid_sregs(vcpu, sregs))
return -EINVAL;
goto out;
apic_base_msr.data = sregs->apic_base;
apic_base_msr.host_initiated = true;