diff options
author | Changbing Xiong <cb.xiong@samsung.com> | 2014-08-20 23:05:40 -0300 |
---|---|---|
committer | Chanho Park <chanho61.park@samsung.com> | 2014-11-18 12:00:43 +0900 |
commit | 4b1b13c1dd4a30294ceffba6ec83e777cf0602ad (patch) | |
tree | c8dbf3647b5a05e333539252ca326da3af5b1e37 /drivers | |
parent | c240ddd14071fbf6de3c439daf64ccca87b5e6a6 (diff) | |
download | linux-3.10-4b1b13c1dd4a30294ceffba6ec83e777cf0602ad.tar.gz linux-3.10-4b1b13c1dd4a30294ceffba6ec83e777cf0602ad.tar.bz2 linux-3.10-4b1b13c1dd4a30294ceffba6ec83e777cf0602ad.zip |
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.
Change-Id: Id685db6f37c7a3f454e4a93234a38bb65dfc43d9
Signed-off-by: Changbing Xiong <cb.xiong@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/dvb-core/dmxdev.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/media/dvb-core/dmxdev.c b/drivers/media/dvb-core/dmxdev.c index 7a5c07003c4..42b5e70d5ca 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) { |