diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2024-07-26 19:26:33 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2024-07-26 19:26:33 +0200 |
commit | dd90ad50cb372056d01a9913ce80aaa526826593 (patch) | |
tree | 664e50c1b3b12af6c526e8ec8c383216d82f2678 /drivers/media/rc | |
parent | arm64: allow installing compressed image by default (diff) | |
parent | lirc: rc_dev_get_from_fd(): fix file leak (diff) | |
download | linux-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 'drivers/media/rc')
-rw-r--r-- | drivers/media/rc/lirc_dev.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/media/rc/lirc_dev.c b/drivers/media/rc/lirc_dev.c index 52aea4167718..717c441b4a86 100644 --- a/drivers/media/rc/lirc_dev.c +++ b/drivers/media/rc/lirc_dev.c @@ -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; |