]> err.no Git - linux-2.6/commitdiff
agp-frontend: BKL pushdown
authorArnd Bergmann <arnd@arndb.de>
Tue, 20 May 2008 17:15:30 +0000 (19:15 +0200)
committerJonathan Corbet <corbet@lwn.net>
Fri, 20 Jun 2008 20:05:54 +0000 (14:05 -0600)
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
drivers/char/agp/frontend.c

index 857b26227d87d69b894f51609a5307fd68ea4bab..963eff28fa0064ba305dd5beda0eae2eb86cf468 100644 (file)
@@ -39,6 +39,7 @@
 #include <linux/mm.h>
 #include <linux/fs.h>
 #include <linux/sched.h>
+#include <linux/smp_lock.h>
 #include <asm/uaccess.h>
 #include <asm/pgtable.h>
 #include "agp.h"
@@ -677,6 +678,7 @@ static int agp_open(struct inode *inode, struct file *file)
        struct agp_client *client;
        int rc = -ENXIO;
 
+       lock_kernel();
        mutex_lock(&(agp_fe.agp_mutex));
 
        if (minor != AGPGART_MINOR)
@@ -703,12 +705,14 @@ static int agp_open(struct inode *inode, struct file *file)
        agp_insert_file_private(priv);
        DBG("private=%p, client=%p", priv, client);
        mutex_unlock(&(agp_fe.agp_mutex));
+       unlock_kernel();
        return 0;
 
 err_out_nomem:
        rc = -ENOMEM;
 err_out:
        mutex_unlock(&(agp_fe.agp_mutex));
+       unlock_kernel();
        return rc;
 }