Commit cad84238 authored by Arnd Bergmann's avatar Arnd Bergmann Committed by Jonathan Corbet

media-radio-miropcm20-rds: BKL pushdown

Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parent b9bde77a
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
#include <linux/module.h> #include <linux/module.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/smp_lock.h>
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/miscdevice.h> #include <linux/miscdevice.h>
#include <linux/delay.h> #include <linux/delay.h>
...@@ -27,13 +28,16 @@ static int rds_f_open(struct inode *in, struct file *fi) ...@@ -27,13 +28,16 @@ static int rds_f_open(struct inode *in, struct file *fi)
if (rds_users) if (rds_users)
return -EBUSY; return -EBUSY;
lock_kernel();
rds_users++; rds_users++;
if ((text_buffer=kmalloc(66, GFP_KERNEL)) == 0) { if ((text_buffer=kmalloc(66, GFP_KERNEL)) == 0) {
rds_users--; rds_users--;
printk(KERN_NOTICE "aci-rds: Out of memory by open()...\n"); printk(KERN_NOTICE "aci-rds: Out of memory by open()...\n");
unlock_kernel();
return -ENOMEM; return -ENOMEM;
} }
unlock_kernel();
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment