aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Corbet <corbet@lwn.net>2008-05-16 16:28:31 -0400
committerJonathan Corbet <corbet@lwn.net>2008-06-20 16:05:53 -0400
commit6606470dd1d628878383c96d10b52a77986ddac7 (patch)
treea7e3eb4ef5c81259bf7bd258981e7efac0b5f7c1
parentb5b4aa67da65aeb58718e0a39158b293873ac572 (diff)
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: Jonathan Corbet <corbet@lwn.net>
-rw-r--r--drivers/media/video/videodev.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/media/video/videodev.c b/drivers/media/video/videodev.c
index 31e8af0ba278..e5679c28163f 100644
--- a/drivers/media/video/videodev.c
+++ b/drivers/media/video/videodev.c
@@ -36,6 +36,7 @@
36#include <linux/init.h> 36#include <linux/init.h>
37#include <linux/kmod.h> 37#include <linux/kmod.h>
38#include <linux/slab.h> 38#include <linux/slab.h>
39#include <linux/smp_lock.h>
39#include <asm/uaccess.h> 40#include <asm/uaccess.h>
40#include <asm/system.h> 41#include <asm/system.h>
41 42
@@ -496,6 +497,7 @@ static int video_open(struct inode *inode, struct file *file)
496 497
497 if(minor>=VIDEO_NUM_DEVICES) 498 if(minor>=VIDEO_NUM_DEVICES)
498 return -ENODEV; 499 return -ENODEV;
500 lock_kernel();
499 mutex_lock(&videodev_lock); 501 mutex_lock(&videodev_lock);
500 vfl=video_device[minor]; 502 vfl=video_device[minor];
501 if(vfl==NULL) { 503 if(vfl==NULL) {
@@ -505,6 +507,7 @@ static int video_open(struct inode *inode, struct file *file)
505 vfl=video_device[minor]; 507 vfl=video_device[minor];
506 if (vfl==NULL) { 508 if (vfl==NULL) {
507 mutex_unlock(&videodev_lock); 509 mutex_unlock(&videodev_lock);
510 unlock_kernel();
508 return -ENODEV; 511 return -ENODEV;
509 } 512 }
510 } 513 }
@@ -518,6 +521,7 @@ static int video_open(struct inode *inode, struct file *file)
518 } 521 }
519 fops_put(old_fops); 522 fops_put(old_fops);
520 mutex_unlock(&videodev_lock); 523 mutex_unlock(&videodev_lock);
524 unlock_kernel();
521 return err; 525 return err;
522} 526}
523 527