]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: x86: Reduce refcount if single_open() fails in kvm_mmu_rmaps_stat_open()
authorHou Wenlong <houwenlong.hwl@antgroup.com>
Fri, 14 Oct 2022 07:55:11 +0000 (15:55 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Thu, 27 Oct 2022 08:41:54 +0000 (04:41 -0400)
commit58fb3e54d5925c730c691f06cf047ed1da34c271
tree31bdbb0d36548f7fe84e6062f27c0e7de0f09a88
parent5387c1a3bf1e78c6fd6ae4b225377cb03532351b
KVM: x86: Reduce refcount if single_open() fails in kvm_mmu_rmaps_stat_open()

Refcount is increased before calling single_open() in
kvm_mmu_rmaps_stat_open(), If single_open() fails, refcount should be
restored, otherwise the vm couldn't be destroyed.

Fixes: 15b9954ec9e62 ("KVM: X86: Introduce mmu_rmaps_stat per-vm debugfs file")
Signed-off-by: Hou Wenlong <houwenlong.hwl@antgroup.com>
Message-Id: <a75900413bb8b1e556be690e9588a0f92e946a30.1665733883.git.houwenlong.hwl@antgroup.com>
[Preserved return value of single_open. - Paolo]
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
arch/x86/kvm/debugfs.c