From: Sean Young <sean@mess.org>
To: linux-media@vger.kernel.org
Subject: [PATCH] [media] lirc: cannot read from tx-only device
Date: Thu, 2 Feb 2017 23:14:35 +0000 [thread overview]
Message-ID: <1486077276-14156-1-git-send-email-sean@mess.org> (raw)
Bail out early, otherwise we follow a null pointer.
Signed-off-by: Sean Young <sean@mess.org>
---
drivers/media/rc/lirc_dev.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/media/rc/lirc_dev.c b/drivers/media/rc/lirc_dev.c
index 0030ce0..a54ca53 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);
--
2.9.3
next reply other threads:[~2017-02-02 23:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-02 23:14 Sean Young [this message]
2017-02-02 23:14 ` [PATCH] [media] mce_kbd: add missing keys from UK layout Sean Young
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1486077276-14156-1-git-send-email-sean@mess.org \
--to=sean@mess.org \
--cc=linux-media@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).