aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char/mbcs.c
diff options
context:
space:
mode:
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