]> err.no Git - linux-2.6/commitdiff
videopix: BKL pushdown
authorJonathan Corbet <corbet@lwn.net>
Fri, 16 May 2008 20:08:58 +0000 (14:08 -0600)
committerJonathan Corbet <corbet@lwn.net>
Fri, 20 Jun 2008 20:05:52 +0000 (14:05 -0600)
Add explicit lock_kernel() calls to vfc_open().

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
drivers/sbus/char/vfc_dev.c

index d4f8fcded51d8615e1da7cd5996ac715b0defd9e..1f6cb8ae2784cddaf76aa949033381b271126037 100644 (file)
@@ -24,6 +24,7 @@
 #include <linux/spinlock.h>
 #include <linux/mutex.h>
 #include <linux/mm.h>
+#include <linux/smp_lock.h>
 
 #include <asm/openprom.h>
 #include <asm/oplib.h>
@@ -178,14 +179,17 @@ static int vfc_open(struct inode *inode, struct file *file)
 {
        struct vfc_dev *dev;
 
+       lock_kernel();
        spin_lock(&vfc_dev_lock);
        dev = vfc_get_dev_ptr(iminor(inode));
        if (dev == NULL) {
                spin_unlock(&vfc_dev_lock);
+               unlock_kernel();
                return -ENODEV;
        }
        if (dev->busy) {
                spin_unlock(&vfc_dev_lock);
+               unlock_kernel();
                return -EBUSY;
        }
 
@@ -202,6 +206,7 @@ static int vfc_open(struct inode *inode, struct file *file)
        vfc_captstat_reset(dev);
        
        vfc_unlock_device(dev);
+       unlock_kernel();
        return 0;
 }