summaryrefslogtreecommitdiff
path: root/drivers/media
diff options
context:
space:
mode:
authorSean Young <sean@mess.org>2017-02-02 01:08:56 +0300
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2017-02-03 19:23:36 +0300
commit32002f725fc708dccc6263b19b56fa3d91626be1 (patch)
tree27cff6e2d7e5c77020f02dae0777f474aa69efc7 /drivers/media
parent7a6628b5c321343647bcb8d79cb0d21222597ca5 (diff)
downloadlinux-32002f725fc708dccc6263b19b56fa3d91626be1.tar.xz
[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>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/rc/lirc_dev.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/media/rc/lirc_dev.c b/drivers/media/rc/lirc_dev.c
index 0030ce01babc..a54ca531d8ef 100644
--- a/drivers/media/rc/lirc_dev.c
+++ b/drivers/media/rc/lirc_dev.c
@@ -647,6 +647,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);