mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-07 19:30:30 +09:00
UPSTREAM: [media] lirc: cannot read from tx-only device
Bail out early, otherwise we follow a null pointer.
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
(cherry picked from commit 32002f725f)
Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com>
This commit is contained in:
@@ -651,6 +651,9 @@ ssize_t lirc_dev_fop_read(struct file *file,
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
if (!LIRC_CAN_REC(ir->d.features))
|
||||
return -EINVAL;
|
||||
|
||||
dev_dbg(ir->d.dev, LOGHEAD "read called\n", ir->d.name, ir->d.minor);
|
||||
|
||||
buf = kzalloc(ir->chunk_size, GFP_KERNEL);
|
||||
|
||||
Reference in New Issue
Block a user