|
|
@@ -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",
|