summaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
authorAl Viro <viro@zeniv.linux.org.uk>2024-05-30 23:54:55 -0400
committerAl Viro <viro@zeniv.linux.org.uk>2024-05-30 23:54:55 -0400
commitb4cf5fc01ce83e5c0bcf3dbb9f929428646b9098 (patch)
tree6d4e695e6dbb2396e35581330283d3a512d80adc /arch/powerpc
parent1613e604df0cd359cf2a7fbd9be7a0bcfacfabd0 (diff)
downloadlinux-stable-b4cf5fc01ce83e5c0bcf3dbb9f929428646b9098.tar.gz
linux-stable-b4cf5fc01ce83e5c0bcf3dbb9f929428646b9098.tar.bz2
linux-stable-b4cf5fc01ce83e5c0bcf3dbb9f929428646b9098.zip
powerpc: fix a file leak in kvm_vcpu_ioctl_enable_cap()
missing fdput() on one of the failure exits Fixes: eacc56bb9de3e # v5.2 Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/kvm/powerpc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/powerpc/kvm/powerpc.c b/arch/powerpc/kvm/powerpc.c
index d32abe7fe6ab..d11767208bfc 100644
--- a/arch/powerpc/kvm/powerpc.c
+++ b/arch/powerpc/kvm/powerpc.c
@@ -1984,8 +1984,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);