when usb-type tuner is pulled out, user applications did not close device's FD,
and go on polling the device, we should return POLLERR directly.
Signed-off-by: Changbing Xiong <cb.xiong@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
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)
+ if ((!dmxdevfilter) || (dmxdev->exit))
return POLLERR;
poll_wait(file, &dmxdevfilter->buffer.queue, wait);
dprintk("function : %s\n", __func__);
+ if (dmxdev->exit)
+ return POLLERR;
+
poll_wait(file, &dmxdev->dvr_buffer.queue, wait);
if ((file->f_flags & O_ACCMODE) == O_RDONLY) {