media: dvb-core/dmxdev: drop locks around mmap()

vb2 no longer requires locking around mmap since commit
f035eb4e97 ("[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>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
master
Hans Verkuil 2025-06-05 08:57:36 +02:00 committed by Mauro Carvalho Chehab
parent c4e620eccb
commit 37fd4a0306
1 changed files with 2 additions and 21 deletions

View File

@ -1217,24 +1217,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
@ -1367,7 +1354,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;
@ -1375,12 +1361,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