Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a237f3bb authored by Jonathan Corbet's avatar Jonathan Corbet
Browse files

CAPI: BKL pushdown



Put explicit lock_kernel() calls into capi_open()

Signed-off-by: default avatarJonathan Corbet <corbet@lwn.net>
parent b0061a0e
Loading
Loading
Loading
Loading
+11 −6
Original line number Diff line number Diff line
@@ -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
@@ -983,13 +984,17 @@ capi_ioctl(struct inode *inode, struct file *file,
static int
capi_open(struct inode *inode, struct file *file)
{
	if (file->private_data)
		return -EEXIST;

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

static int