aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/mbcs.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/char/mbcs.c
parent585583d95c5660973bc0cf64add517b040acd8a4 (diff)
parent85082fd7cbe3173198aac0eb5e85ab1edcc6352c (diff)
Merge commit '85082fd7cbe3173198aac0eb5e85ab1edcc6352c' into test-build
Manual fixup of: arch/powerpc/Kconfig
Diffstat (limited to 'drivers/char/mbcs.c')
-rw-r--r--drivers/char/mbcs.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/char/mbcs.c b/drivers/char/mbcs.c
index f4716ad7348a..acd8e9ed474a 100644
--- a/drivers/char/mbcs.c
+++ b/drivers/char/mbcs.c
@@ -24,6 +24,7 @@
24#include <linux/mm.h> 24#include <linux/mm.h>
25#include <linux/uio.h> 25#include <linux/uio.h>
26#include <linux/mutex.h> 26#include <linux/mutex.h>
27#include <linux/smp_lock.h>
27#include <asm/io.h> 28#include <asm/io.h>
28#include <asm/uaccess.h> 29#include <asm/uaccess.h>
29#include <asm/system.h> 30#include <asm/system.h>
@@ -382,15 +383,19 @@ static int mbcs_open(struct inode *ip, struct file *fp)
382 struct mbcs_soft *soft; 383 struct mbcs_soft *soft;
383 int minor; 384 int minor;
384 385
386 lock_kernel();
385 minor = iminor(ip); 387 minor = iminor(ip);
386 388
389 /* Nothing protects access to this list... */
387 list_for_each_entry(soft, &soft_list, list) { 390 list_for_each_entry(soft, &soft_list, list) {
388 if (soft->nasid == minor) { 391 if (soft->nasid == minor) {
389 fp->private_data = soft->cxdev; 392 fp->private_data = soft->cxdev;
393 unlock_kernel();
390 return 0; 394 return 0;
391 } 395 }
392 } 396 }
393 397
398 unlock_kernel();
394 return -ENODEV; 399 return -ENODEV;
395} 400}
396 401