sony-laptop: BKL pushdown
authorArnd Bergmann <arnd@arndb.de>
Tue, 20 May 2008 17:16:45 +0000 (19:16 +0200)
committerJonathan Corbet <corbet@lwn.net>
Wed, 2 Jul 2008 21:06:25 +0000 (15:06 -0600)
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
drivers/misc/sony-laptop.c

index 00e48e2a9c11229da5576897d566fead0ac2a8f4..60775be22822901f0a67e70878eceac666ab1afa 100644 (file)
@@ -46,6 +46,7 @@
 #include <linux/module.h>
 #include <linux/moduleparam.h>
 #include <linux/init.h>
+#include <linux/smp_lock.h>
 #include <linux/types.h>
 #include <linux/backlight.h>
 #include <linux/platform_device.h>
@@ -1927,8 +1928,10 @@ static int sonypi_misc_release(struct inode *inode, struct file *file)
 static int sonypi_misc_open(struct inode *inode, struct file *file)
 {
        /* Flush input queue on first open */
+       lock_kernel();
        if (atomic_inc_return(&sonypi_compat.open_count) == 1)
                kfifo_reset(sonypi_compat.fifo);
+       unlock_kernel();
        return 0;
 }