Commit 313ddec4 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

[media] dmxdev: don't use before checking file->private_data

As reported by smatch:
	drivers/media/dvb-core/dmxdev.c:1091 dvb_demux_poll() warn: variable dereferenced before check 'dmxdevfilter' (see line 1088)

This was introduced by changeset d102cac8.

We need to test before using it.
Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
parent fe10b84e
......@@ -1085,10 +1085,9 @@ static long dvb_demux_ioctl(struct file *file, unsigned int cmd,
static unsigned int dvb_demux_poll(struct file *file, poll_table *wait)
{
struct dmxdev_filter *dmxdevfilter = file->private_data;
struct dmxdev *dmxdev = dmxdevfilter->dev;
unsigned int mask = 0;
if ((!dmxdevfilter) || (dmxdev->exit))
if ((!dmxdevfilter) || dmxdevfilter->dev->exit)
return POLLERR;
poll_wait(file, &dmxdevfilter->buffer.queue, wait);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment