CAPI: BKL pushdown
Put explicit lock_kernel() calls into capi_open() Signed-off-by: Jonathan Corbet <corbet@lwn.net>
This commit is contained in:
parent
b0061a0ec4
commit
a237f3bbaa
|
@ -20,6 +20,7 @@
|
||||||
#include <linux/signal.h>
|
#include <linux/signal.h>
|
||||||
#include <linux/mutex.h>
|
#include <linux/mutex.h>
|
||||||
#include <linux/mm.h>
|
#include <linux/mm.h>
|
||||||
|
#include <linux/smp_lock.h>
|
||||||
#include <linux/timer.h>
|
#include <linux/timer.h>
|
||||||
#include <linux/wait.h>
|
#include <linux/wait.h>
|
||||||
#ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
|
#ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
|
||||||
|
@ -983,13 +984,17 @@ capi_ioctl(struct inode *inode, struct file *file,
|
||||||
static int
|
static int
|
||||||
capi_open(struct inode *inode, struct file *file)
|
capi_open(struct inode *inode, struct file *file)
|
||||||
{
|
{
|
||||||
|
int ret;
|
||||||
|
|
||||||
|
lock_kernel();
|
||||||
if (file->private_data)
|
if (file->private_data)
|
||||||
return -EEXIST;
|
ret = -EEXIST;
|
||||||
|
else if ((file->private_data = capidev_alloc()) == NULL)
|
||||||
if ((file->private_data = capidev_alloc()) == NULL)
|
ret = -ENOMEM;
|
||||||
return -ENOMEM;
|
else
|
||||||
|
ret = nonseekable_open(inode, file);
|
||||||
return nonseekable_open(inode, file);
|
unlock_kernel();
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
|
Reference in New Issue