diff options
author | Al Viro <viro@zeniv.linux.org.uk> | 2024-05-31 06:54:55 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2024-08-03 09:49:50 +0300 |
commit | 802293e2c458147eebd9f81d4256e4c657a917cd (patch) | |
tree | 7cd392aad19972df39aba03dd31ce3c0db84a591 | |
parent | ead2ad1d9f045f26fdce3ef1644913b3a6cd38f2 (diff) | |
download | linux-802293e2c458147eebd9f81d4256e4c657a917cd.tar.xz |
powerpc: fix a file leak in kvm_vcpu_ioctl_enable_cap()
[ Upstream commit b4cf5fc01ce83e5c0bcf3dbb9f929428646b9098 ]
missing fdput() on one of the failure exits
Fixes: eacc56bb9de3e # v5.2
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
-rw-r--r-- | arch/powerpc/kvm/powerpc.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c index b850b0efa201..98ac5d39ad9c 100644 --- a/arch/powerpc/kvm/powerpc.c +++ b/arch/powerpc/kvm/powerpc.c @@ -1998,8 +1998,10 @@ static int kvm_vcpu_ioctl_enable_cap(struct kvm_vcpu *vcpu, break; r = -ENXIO; - if (!xive_enabled()) + if (!xive_enabled()) { + fdput(f); break; + } r = -EPERM; dev = kvm_device_from_filp(f.file); |