]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
media: dvb-core/dmxdev: drop locks around mmap()
authorHans Verkuil <hverkuil@xs4all.nl>
Thu, 5 Jun 2025 06:57:36 +0000 (08:57 +0200)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Thu, 18 Dec 2025 10:14:56 +0000 (11:14 +0100)
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>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/dvb-core/dmxdev.c

index 17184b367490442862b55d15b54af8fb67c0181e..1cc0e9ecc56ad53c4abccb2cf6569d1fe29195cf 100644 (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