aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/v4l2-dev.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/v4l2-dev.c')
-rw-r--r--drivers/media/video/v4l2-dev.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/media/video/v4l2-dev.c b/drivers/media/video/v4l2-dev.c
index 0ca7978654b5..03f7f4670e9b 100644
--- a/drivers/media/video/v4l2-dev.c
+++ b/drivers/media/video/v4l2-dev.c
@@ -25,7 +25,6 @@
25#include <linux/init.h> 25#include <linux/init.h>
26#include <linux/kmod.h> 26#include <linux/kmod.h>
27#include <linux/slab.h> 27#include <linux/slab.h>
28#include <linux/smp_lock.h>
29#include <asm/uaccess.h> 28#include <asm/uaccess.h>
30#include <asm/system.h> 29#include <asm/system.h>
31 30
@@ -247,10 +246,12 @@ static long v4l2_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
247 mutex_unlock(vdev->lock); 246 mutex_unlock(vdev->lock);
248 } else if (vdev->fops->ioctl) { 247 } else if (vdev->fops->ioctl) {
249 /* TODO: convert all drivers to unlocked_ioctl */ 248 /* TODO: convert all drivers to unlocked_ioctl */
250 lock_kernel(); 249 static DEFINE_MUTEX(v4l2_ioctl_mutex);
250
251 mutex_lock(&v4l2_ioctl_mutex);
251 if (video_is_registered(vdev)) 252 if (video_is_registered(vdev))
252 ret = vdev->fops->ioctl(filp, cmd, arg); 253 ret = vdev->fops->ioctl(filp, cmd, arg);
253 unlock_kernel(); 254 mutex_unlock(&v4l2_ioctl_mutex);
254 } else 255 } else
255 ret = -ENOTTY; 256 ret = -ENOTTY;
256 257