diff options
Diffstat (limited to 'drivers/media/rc/lirc_dev.c')
-rw-r--r-- | drivers/media/rc/lirc_dev.c | 6 |
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) 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", |