From 12ead6b098b65dd21d3ed4fcccf20025dbe86cc2 Mon Sep 17 00:00:00 2001 From: Jonathan Corbet Date: Thu, 15 May 2008 11:24:23 -0600 Subject: mbcs: cdev lock_kernel() pushdown This driver would appear to have no internal locking at all. Signed-off-by: Jonathan Corbet --- drivers/char/mbcs.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'drivers/char') diff --git a/drivers/char/mbcs.c b/drivers/char/mbcs.c index f4716ad7348..acd8e9ed474 100644 --- a/drivers/char/mbcs.c +++ b/drivers/char/mbcs.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -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; } -- cgit v1.2.3