mirror of
https://github.com/nxp-imx/linux-imx.git
synced 2025-07-11 11:55:28 +02:00
lirc: rc_dev_get_from_fd(): fix file leak
[ Upstream commitbba1f6758a
] missing fdput() on a failure exit Fixes:6a9d552483
"media: rc: bpf attach/detach requires write permission" # v6.9 Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
4f79a18af9
commit
f4c6ebb053
|
@ -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