diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-07-19 23:53:41 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-07-19 23:53:41 -0300 |
commit | 98bc745f4c1ff3cdd2b9da0595d65056886786cd (patch) | |
tree | b5baed42e5ce24bf28e86e06fff0c5135c76c7ba | |
parent | e68d63cdeb1115d0fd27f54d413ba25c1b3216f9 (diff) | |
download | mediapointer-dvb-s2-98bc745f4c1ff3cdd2b9da0595d65056886786cd.tar.gz mediapointer-dvb-s2-98bc745f4c1ff3cdd2b9da0595d65056886786cd.tar.bz2 |
backport commit 6606470dd1d628878383c96d10b52a77986ddac7
From: Mauro Carvalho Chehab <mchehab@infradead.org>
Author: Jonathan Corbet <corbet@lwn.net>
Date: Fri May 16 14:28:31 2008 -0600
videodev: BKL pushdown
Put explicit lock_kernel() calls into videodev_open(). That function
itself seems OK, but one never knows about all the open() functions
provided by underlying video drivers.
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
-rw-r--r-- | linux/drivers/media/video/videodev.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/linux/drivers/media/video/videodev.c b/linux/drivers/media/video/videodev.c index b32b59afd..48e03618a 100644 --- a/linux/drivers/media/video/videodev.c +++ b/linux/drivers/media/video/videodev.c @@ -40,6 +40,7 @@ #include <linux/init.h> #include <linux/kmod.h> #include <linux/slab.h> +#include <linux/smp_lock.h> #include <asm/uaccess.h> #include <asm/system.h> @@ -492,6 +493,7 @@ static int video_open(struct inode *inode, struct file *file) if(minor>=VIDEO_NUM_DEVICES) return -ENODEV; + lock_kernel(); mutex_lock(&videodev_lock); vfl=video_device[minor]; if(vfl==NULL) { @@ -501,6 +503,7 @@ static int video_open(struct inode *inode, struct file *file) vfl=video_device[minor]; if (vfl==NULL) { mutex_unlock(&videodev_lock); + unlock_kernel(); return -ENODEV; } } @@ -518,6 +521,7 @@ static int video_open(struct inode *inode, struct file *file) } fops_put(old_fops); mutex_unlock(&videodev_lock); + unlock_kernel(); return err; } |