Skip to content

Commit

Permalink
videopix: BKL pushdown
Browse files Browse the repository at this point in the history
Add explicit lock_kernel() calls to vfc_open().

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
  • Loading branch information
Jonathan Corbet committed Jun 20, 2008
1 parent 5e9829a commit 9aaf20c
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions drivers/sbus/char/vfc_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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;
}

Expand All @@ -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;
}

Expand Down

0 comments on commit 9aaf20c

Please sign in to comment.