lirc_dev: avoid potential null-dereference
A message that is not in the archive (sent off-list or not yet received): [email protected]
Quoted 8 lines · Mauro Carvalho Chehab
This is an automatic generated email to let you know that the following patch were queued at the
http://git.linuxtv.org/cgit.cgi/media_tree.git tree:Subject: [media] lirc_dev: avoid potential null-dereference Author: Andy Shevchenko <[email protected]> Date: Tue Jan 6 22:53:37 2015 -0300We have to check pointer for NULL and then dereference it.
Sorry, seems I forgot to write that it is non-needed fix. Regarding to the current poll_wait() implementation and that fact that wait_poll is a first member of the struct lirc_buffer there is no dereference.
Quoted 33 lines
Signed-off-by Andy Shevchenko <[email protected]>Signed-off-by Mauro Carvalho Chehab <[email protected]>drivers/media/rc/lirc_dev.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)---
http://git.linuxtv.org/cgit.cgi/media_tree.git/commit/?id=3656cddd50018d562d2df87c4698783898732914
drivers/media/rc/lirc_dev.c +3
-3@@ -553,14 +553,14 @@ unsigned int lirc_dev_fop_poll(struct file *file, poll_table *wait)if (!ir->attached)return POLLERR ; -poll_wait (file, &ir->buf->wait_poll, wait); +if (ir->buf) { +poll_wait (file, &ir->buf->wait_poll, wait); -if (ir->buf)if (lirc_buffer_empty (ir->buf)) ret =0 ;else ret =POLLIN |POLLRDNORM ; -else + }else ret =POLLERR ; dev_dbg(ir->d.dev, LOGHEAD "poll result = %d\n",
Signature · 2 lines
With Best Regards, Andy Shevchenko