@@ -1216,24 +1216,11 @@ static int dvb_demux_mmap(struct file *file, struct vm_area_struct *vma)
{
struct dmxdev_filter *dmxdevfilter = file->private_data;
struct dmxdev *dmxdev = dmxdevfilter->dev;
- int ret;
if (!dmxdev->may_do_mmap)
return -ENOTTY;
- if (mutex_lock_interruptible(&dmxdev->mutex))
- return -ERESTARTSYS;
-
- if (mutex_lock_interruptible(&dmxdevfilter->mutex)) {
- mutex_unlock(&dmxdev->mutex);
- return -ERESTARTSYS;
- }
- ret = dvb_vb2_mmap(&dmxdevfilter->vb2_ctx, vma);
-
- mutex_unlock(&dmxdevfilter->mutex);
- mutex_unlock(&dmxdev->mutex);
-
- return ret;
+ return dvb_vb2_mmap(&dmxdevfilter->vb2_ctx, vma);
}
#endif
@@ -1366,7 +1353,6 @@ static int dvb_dvr_mmap(struct file *file, struct vm_area_struct *vma)
{
struct dvb_device *dvbdev = file->private_data;
struct dmxdev *dmxdev = dvbdev->priv;
- int ret;
if (!dmxdev->may_do_mmap)
return -ENOTTY;
@@ -1374,12 +1360,7 @@ static int dvb_dvr_mmap(struct file *file, struct vm_area_struct *vma)
if (dmxdev->exit)
return -ENODEV;
- if (mutex_lock_interruptible(&dmxdev->mutex))
- return -ERESTARTSYS;
-
- ret = dvb_vb2_mmap(&dmxdev->dvr_vb2_ctx, vma);
- mutex_unlock(&dmxdev->mutex);
- return ret;
+ return dvb_vb2_mmap(&dmxdev->dvr_vb2_ctx, vma);
}
#endif
vb2 no longer requires locking around mmap since commit f035eb4e976e ("[media] videobuf2: fix lockdep warning"). Since the streaming I/O mode for DVB support is by default off, and the dvb utilities were never updated with streaming support, and we never had regression tests for this streaming mode, this was never noticed before. Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl> --- drivers/media/dvb-core/dmxdev.c | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-)