summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kvm/powerpc.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2024-07-26 19:26:33 +0200
committerLinus Torvalds <torvalds@linux-foundation.org>2024-07-26 19:26:33 +0200
commitdd90ad50cb372056d01a9913ce80aaa526826593 (patch)
tree664e50c1b3b12af6c526e8ec8c383216d82f2678 /arch/powerpc/kvm/powerpc.c
parentarm64: allow installing compressed image by default (diff)
parentlirc: rc_dev_get_from_fd(): fix file leak (diff)
downloadlinux-dd90ad50cb372056d01a9913ce80aaa526826593.tar.xz
linux-dd90ad50cb372056d01a9913ce80aaa526826593.zip
Merge tag 'pull-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull struct file leak fixes from Al Viro: "a couple of leaks on failure exits missing fdput()" * tag 'pull-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: lirc: rc_dev_get_from_fd(): fix file leak powerpc: fix a file leak in kvm_vcpu_ioctl_enable_cap()
Diffstat (limited to 'arch/powerpc/kvm/powerpc.c')
-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 961aadc71de2..5e6c7b527677 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);