Skip to content

Commit b4cf5fc

Browse files
author
Al Viro
committed
powerpc: fix a file leak in kvm_vcpu_ioctl_enable_cap()
missing fdput() on one of the failure exits Fixes: eacc56b # v5.2 Signed-off-by: Al Viro <[email protected]>
1 parent 1613e60 commit b4cf5fc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

arch/powerpc/kvm/powerpc.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1984,8 +1984,10 @@ static int kvm_vcpu_ioctl_enable_cap(struct kvm_vcpu *vcpu,
19841984
break;
19851985

19861986
r = -ENXIO;
1987-
if (!xive_enabled())
1987+
if (!xive_enabled()) {
1988+
fdput(f);
19881989
break;
1990+
}
19891991

19901992
r = -EPERM;
19911993
dev = kvm_device_from_filp(f.file);

0 commit comments

Comments
 (0)