aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/radio/miropcm20-rds.c
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2008-07-15 01:44:51 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2008-07-15 01:44:51 -0400
commit43d2548bb2ef7e6d753f91468a746784041e522d (patch)
tree77d13fcd48fd998393abb825ec36e2b732684a73 /drivers/media/radio/miropcm20-rds.c
parent585583d95c5660973bc0cf64add517b040acd8a4 (diff)
parent85082fd7cbe3173198aac0eb5e85ab1edcc6352c (diff)
Merge commit '85082fd7cbe3173198aac0eb5e85ab1edcc6352c' into test-build
Manual fixup of: arch/powerpc/Kconfig
Diffstat (limited to 'drivers/media/radio/miropcm20-rds.c')
-rw-r--r--drivers/media/radio/miropcm20-rds.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/media/radio/miropcm20-rds.c b/drivers/media/radio/miropcm20-rds.c
index 06dfed9ef4c7..3e840f74d45c 100644
--- a/drivers/media/radio/miropcm20-rds.c
+++ b/drivers/media/radio/miropcm20-rds.c
@@ -12,6 +12,7 @@
12#include <linux/module.h> 12#include <linux/module.h>
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/slab.h> 14#include <linux/slab.h>
15#include <linux/smp_lock.h>
15#include <linux/fs.h> 16#include <linux/fs.h>
16#include <linux/miscdevice.h> 17#include <linux/miscdevice.h>
17#include <linux/delay.h> 18#include <linux/delay.h>
@@ -27,13 +28,16 @@ static int rds_f_open(struct inode *in, struct file *fi)
27 if (rds_users) 28 if (rds_users)
28 return -EBUSY; 29 return -EBUSY;
29 30
31 lock_kernel();
30 rds_users++; 32 rds_users++;
31 if ((text_buffer=kmalloc(66, GFP_KERNEL)) == 0) { 33 if ((text_buffer=kmalloc(66, GFP_KERNEL)) == 0) {
32 rds_users--; 34 rds_users--;
33 printk(KERN_NOTICE "aci-rds: Out of memory by open()...\n"); 35 printk(KERN_NOTICE "aci-rds: Out of memory by open()...\n");
36 unlock_kernel();
34 return -ENOMEM; 37 return -ENOMEM;
35 } 38 }
36 39
40 unlock_kernel();
37 return 0; 41 return 0;
38} 42}
39 43