summaryrefslogtreecommitdiffstats
path: root/drivers/char/mbcs.c
diff options
context:
space:
mode:
authorJonathan Corbet <corbet@lwn.net>2008-05-15 19:24:23 +0200
committerJonathan Corbet <corbet@lwn.net>2008-06-20 22:05:48 +0200
commit12ead6b098b65dd21d3ed4fcccf20025dbe86cc2 (patch)
treea45d63c7e0d2c60949b6ffe5cbc19c2b38d20968 /drivers/char/mbcs.c
parentviotape: cdev lock_kernel pushdown () (diff)
downloadlinux-12ead6b098b65dd21d3ed4fcccf20025dbe86cc2.tar.xz
linux-12ead6b098b65dd21d3ed4fcccf20025dbe86cc2.zip
mbcs: cdev lock_kernel() pushdown
This driver would appear to have no internal locking at all. Signed-off-by: Jonathan Corbet <corbet@lwn.net>
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 @@
#include <linux/mm.h>
#include <linux/uio.h>
#include <linux/mutex.h>
+#include <linux/smp_lock.h>
#include <asm/io.h>
#include <asm/uaccess.h>
#include <asm/system.h>
@@ -382,15 +383,19 @@ static int mbcs_open(struct inode *ip, struct file *fp)
struct mbcs_soft *soft;
int minor;
+ lock_kernel();
minor = iminor(ip);
+ /* Nothing protects access to this list... */
list_for_each_entry(soft, &soft_list, list) {
if (soft->nasid == minor) {
fp->private_data = soft->cxdev;
+ unlock_kernel();
return 0;
}
}
+ unlock_kernel();
return -ENODEV;
}