projects
/
GitHub
/
moto-9609
/
android_kernel_motorola_exynos9610.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7a6628b
)
[media] lirc: cannot read from tx-only device
author
Sean Young
<sean@mess.org>
Wed, 1 Feb 2017 22:08:56 +0000
(20:08 -0200)
committer
Mauro Carvalho Chehab
<mchehab@s-opensource.com>
Fri, 3 Feb 2017 16:23:36 +0000
(14:23 -0200)
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>
drivers/media/rc/lirc_dev.c
patch
|
blob
|
blame
|
history
diff --git
a/drivers/media/rc/lirc_dev.c
b/drivers/media/rc/lirc_dev.c
index 0030ce01babc86dabc92354344d3636c0acc288c..a54ca531d8ef85280c8cf9df7b7b19ac226f7032 100644
(file)
--- 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);