]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
tpm-tpm: BKL pushdown
authorArnd Bergmann <arnd@arndb.de>
Tue, 20 May 2008 17:16:51 +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/char/tpm/tpm.c

index a5d8bcb40000df912d43cb9ad4a8cc9c7453642c..e1fc193d9396fc69c41ecd868fd2bd2d60ff73b7 100644 (file)
@@ -26,6 +26,7 @@
 #include <linux/poll.h>
 #include <linux/mutex.h>
 #include <linux/spinlock.h>
+#include <linux/smp_lock.h>
 
 #include "tpm.h"
 
@@ -897,6 +898,7 @@ int tpm_open(struct inode *inode, struct file *file)
        int rc = 0, minor = iminor(inode);
        struct tpm_chip *chip = NULL, *pos;
 
+       lock_kernel();
        spin_lock(&driver_lock);
 
        list_for_each_entry(pos, &tpm_chip_list, list) {
@@ -926,16 +928,19 @@ int tpm_open(struct inode *inode, struct file *file)
        if (chip->data_buffer == NULL) {
                chip->num_opens--;
                put_device(chip->dev);
+               unlock_kernel();
                return -ENOMEM;
        }
 
        atomic_set(&chip->data_pending, 0);
 
        file->private_data = chip;
+       unlock_kernel();
        return 0;
 
 err_out:
        spin_unlock(&driver_lock);
+       unlock_kernel();
        return rc;
 }
 EXPORT_SYMBOL_GPL(tpm_open);