Skip to content

Commit bba1f67

Browse files
author
Al Viro
committed
lirc: rc_dev_get_from_fd(): fix file leak
missing fdput() on a failure exit Fixes: 6a9d552 "media: rc: bpf attach/detach requires write permission" # v6.9 Signed-off-by: Al Viro <[email protected]>
1 parent b4cf5fc commit bba1f67

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

drivers/media/rc/lirc_dev.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -828,8 +828,10 @@ struct rc_dev *rc_dev_get_from_fd(int fd, bool write)
828828
return ERR_PTR(-EINVAL);
829829
}
830830

831-
if (write && !(f.file->f_mode & FMODE_WRITE))
831+
if (write && !(f.file->f_mode & FMODE_WRITE)) {
832+
fdput(f);
832833
return ERR_PTR(-EPERM);
834+
}
833835

834836
fh = f.file->private_data;
835837
dev = fh->rc;

0 commit comments

Comments
 (0)