mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-21 08:19:28 +00:00
videopix: BKL pushdown
Add explicit lock_kernel() calls to vfc_open(). Signed-off-by: Jonathan Corbet <corbet@lwn.net>
This commit is contained in:
parent
5e9829ad38
commit
9aaf20cbf5
1 changed files with 5 additions and 0 deletions
|
@ -24,6 +24,7 @@
|
||||||
#include <linux/spinlock.h>
|
#include <linux/spinlock.h>
|
||||||
#include <linux/mutex.h>
|
#include <linux/mutex.h>
|
||||||
#include <linux/mm.h>
|
#include <linux/mm.h>
|
||||||
|
#include <linux/smp_lock.h>
|
||||||
|
|
||||||
#include <asm/openprom.h>
|
#include <asm/openprom.h>
|
||||||
#include <asm/oplib.h>
|
#include <asm/oplib.h>
|
||||||
|
@ -178,14 +179,17 @@ static int vfc_open(struct inode *inode, struct file *file)
|
||||||
{
|
{
|
||||||
struct vfc_dev *dev;
|
struct vfc_dev *dev;
|
||||||
|
|
||||||
|
lock_kernel();
|
||||||
spin_lock(&vfc_dev_lock);
|
spin_lock(&vfc_dev_lock);
|
||||||
dev = vfc_get_dev_ptr(iminor(inode));
|
dev = vfc_get_dev_ptr(iminor(inode));
|
||||||
if (dev == NULL) {
|
if (dev == NULL) {
|
||||||
spin_unlock(&vfc_dev_lock);
|
spin_unlock(&vfc_dev_lock);
|
||||||
|
unlock_kernel();
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
if (dev->busy) {
|
if (dev->busy) {
|
||||||
spin_unlock(&vfc_dev_lock);
|
spin_unlock(&vfc_dev_lock);
|
||||||
|
unlock_kernel();
|
||||||
return -EBUSY;
|
return -EBUSY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -202,6 +206,7 @@ static int vfc_open(struct inode *inode, struct file *file)
|
||||||
vfc_captstat_reset(dev);
|
vfc_captstat_reset(dev);
|
||||||
|
|
||||||
vfc_unlock_device(dev);
|
vfc_unlock_device(dev);
|
||||||
|
unlock_kernel();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue