]> err.no Git - linux-2.6/commitdiff
media-radio-miropcm20-rds: BKL pushdown
authorArnd Bergmann <arnd@arndb.de>
Tue, 20 May 2008 17:16:12 +0000 (19:16 +0200)
committerJonathan Corbet <corbet@lwn.net>
Fri, 20 Jun 2008 20:05:58 +0000 (14:05 -0600)
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
drivers/media/radio/miropcm20-rds.c

index 06dfed9ef4c7194d043999d23ed7eda35e9025c4..3e840f74d45cc217f3443b43df248904cb650b61 100644 (file)
@@ -12,6 +12,7 @@
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/slab.h>
+#include <linux/smp_lock.h>
 #include <linux/fs.h>
 #include <linux/miscdevice.h>
 #include <linux/delay.h>
@@ -27,13 +28,16 @@ static int rds_f_open(struct inode *in, struct file *fi)
        if (rds_users)
                return -EBUSY;
 
+       lock_kernel();
        rds_users++;
        if ((text_buffer=kmalloc(66, GFP_KERNEL)) == 0) {
                rds_users--;
                printk(KERN_NOTICE "aci-rds: Out of memory by open()...\n");
+               unlock_kernel();
                return -ENOMEM;
        }
 
+       unlock_kernel();
        return 0;
 }