Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3656cddd authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Mauro Carvalho Chehab
Browse files

[media] lirc_dev: avoid potential null-dereference



We have to check pointer for NULL and then dereference it.

Signed-off-by: default avatarAndy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@osg.samsung.com>
parent 5ee803a2
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -553,14 +553,14 @@ unsigned int lirc_dev_fop_poll(struct file *file, poll_table *wait)
	if (!ir->attached)
		return POLLERR;

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