mirror of
https://github.com/torvalds/linux.git
synced 2024-11-21 19:41:42 +00:00
a couple of leaks on failure exits missing fdput()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQQqUNBr3gm4hGXdBJlZ7Krx/gZQ6wUCZllLrAAKCRBZ7Krx/gZQ 65n8AP40w8ghf88QMpI6jhxmxQdaiGFQp+AohS/iwyX7t8PgqgEAuhkcmGJpGahr GZq6/dxugqyNwCtNJPBWAr2x4GXbaA0= =+J5A -----END PGP SIGNATURE----- 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()
This commit is contained in:
commit
dd90ad50cb
@ -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);
|
||||
|
@ -828,8 +828,10 @@ struct rc_dev *rc_dev_get_from_fd(int fd, bool write)
|
||||
return ERR_PTR(-EINVAL);
|
||||
}
|
||||
|
||||
if (write && !(f.file->f_mode & FMODE_WRITE))
|
||||
if (write && !(f.file->f_mode & FMODE_WRITE)) {
|
||||
fdput(f);
|
||||
return ERR_PTR(-EPERM);
|
||||
}
|
||||
|
||||
fh = f.file->private_data;
|
||||
dev = fh->rc;
|
||||
|
Loading…
Reference in New Issue
Block a user