summaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb-core
diff options
context:
space:
mode:
authorChangbing Xiong <cb.xiong@samsung.com>2014-08-20 23:05:40 -0300
committerMauro Carvalho Chehab <m.chehab@samsung.com>2014-09-02 11:50:42 -0300
commitd102cac8097c71bbbba41f4d0cdf5b509d4c64cf (patch)
tree50f723773396cce972ede6c77e8bc107aae5e615 /drivers/media/dvb-core
parent236c9bfa4a133cbdfeeb3f7a1902950210549634 (diff)
downloadop-kernel-dev-d102cac8097c71bbbba41f4d0cdf5b509d4c64cf.zip
op-kernel-dev-d102cac8097c71bbbba41f4d0cdf5b509d4c64cf.tar.gz
[media] media: check status of dmxdev->exit in poll functions of demux&dvr
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>
Diffstat (limited to 'drivers/media/dvb-core')
-rw-r--r--drivers/media/dvb-core/dmxdev.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/media/dvb-core/dmxdev.c b/drivers/media/dvb-core/dmxdev.c
index 7a5c070..42b5e70 100644
--- a/drivers/media/dvb-core/dmxdev.c
+++ b/drivers/media/dvb-core/dmxdev.c
@@ -1085,9 +1085,10 @@ 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)
+ if ((!dmxdevfilter) || (dmxdev->exit))
return POLLERR;
poll_wait(file, &dmxdevfilter->buffer.queue, wait);
@@ -1181,6 +1182,9 @@ static unsigned int dvb_dvr_poll(struct file *file, poll_table *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) {
OpenPOWER on IntegriCloud