aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorAndy Shevchenko <andy.shevchenko@gmail.com>2015-01-06 20:53:37 -0500
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-02-03 14:33:42 -0500
commit3656cddd50018d562d2df87c4698783898732914 (patch)
treeb463e832e70a6ca3e774a375627f0b5f38acb5c8 /drivers/media
parent5ee803a20f4a6569290c1cd20dcb7e795c8dba21 (diff)
[media] lirc_dev: avoid potential null-dereference
We have to check pointer for NULL and then dereference it. Signed-off-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/rc/lirc_dev.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/media/rc/lirc_dev.c b/drivers/media/rc/lirc_dev.c
index 1e0545a67959..4de0e85af805 100644
--- a/drivers/media/rc/lirc_dev.c
+++ b/drivers/media/rc/lirc_dev.c
@@ -553,14 +553,14 @@ unsigned int lirc_dev_fop_poll(struct file *file, poll_table *wait)
553 if (!ir->attached) 553 if (!ir->attached)
554 return POLLERR; 554 return POLLERR;
555 555
556 poll_wait(file, &ir->buf->wait_poll, wait); 556 if (ir->buf) {
557 poll_wait(file, &ir->buf->wait_poll, wait);
557 558
558 if (ir->buf)
559 if (lirc_buffer_empty(ir->buf)) 559 if (lirc_buffer_empty(ir->buf))
560 ret = 0; 560 ret = 0;
561 else 561 else
562 ret = POLLIN | POLLRDNORM; 562 ret = POLLIN | POLLRDNORM;
563 else 563 } else
564 ret = POLLERR; 564 ret = POLLERR;
565 565
566 dev_dbg(ir->d.dev, LOGHEAD "poll result = %d\n", 566 dev_dbg(ir->d.dev, LOGHEAD "poll result = %d\n",