Skip to content

Commit

Permalink
CAPI: BKL pushdown
Browse files Browse the repository at this point in the history
Put explicit lock_kernel() calls into capi_open()

Signed-off-by: Jonathan Corbet <corbet@lwn.net>
  • Loading branch information
Jonathan Corbet committed Jun 20, 2008
1 parent b0061a0 commit a237f3b
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions drivers/isdn/capi/capi.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include <linux/signal.h>
#include <linux/mutex.h>
#include <linux/mm.h>
#include <linux/smp_lock.h>
#include <linux/timer.h>
#include <linux/wait.h>
#ifdef CONFIG_ISDN_CAPI_MIDDLEWARE
Expand Down Expand Up @@ -983,13 +984,17 @@ capi_ioctl(struct inode *inode, struct file *file,
static int
capi_open(struct inode *inode, struct file *file)
{
int ret;

lock_kernel();
if (file->private_data)
return -EEXIST;

if ((file->private_data = capidev_alloc()) == NULL)
return -ENOMEM;

return nonseekable_open(inode, file);
ret = -EEXIST;
else if ((file->private_data = capidev_alloc()) == NULL)
ret = -ENOMEM;
else
ret = nonseekable_open(inode, file);
unlock_kernel();
return ret;
}

static int
Expand Down

0 comments on commit a237f3b

Please sign in to comment.