Skip to content

Commit

Permalink
briq_panel: BKL pushdown
Browse files Browse the repository at this point in the history
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
  • Loading branch information
Arnd Bergmann authored and Jonathan Corbet committed Jun 20, 2008
1 parent 8324af6 commit 556889a
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions drivers/char/briq_panel.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include <linux/module.h>

#include <linux/smp_lock.h>
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/tty.h>
Expand Down Expand Up @@ -67,11 +68,15 @@ static void set_led(char state)

static int briq_panel_open(struct inode *ino, struct file *filep)
{
/* enforce single access */
if (vfd_is_open)
lock_kernel();
/* enforce single access, vfd_is_open is protected by BKL */
if (vfd_is_open) {
unlock_kernel();
return -EBUSY;
}
vfd_is_open = 1;

unlock_kernel();
return 0;
}

Expand Down

0 comments on commit 556889a

Please sign in to comment.