summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorJonathan Corbet <corbet@lwn.net>2008-05-15 21:58:31 +0400
committerJonathan Corbet <corbet@lwn.net>2008-06-21 00:05:48 +0400
commit16750c2f32e3fd879fce787a13900f11633ef9af (patch)
tree5fe0c4fff83d764f1ca4e41dc23462bb0671b150 /drivers
parent70ffa16e604bab22b12bf72cb7796f1dd01ec335 (diff)
downloadlinux-16750c2f32e3fd879fce787a13900f11633ef9af.tar.xz
phonedev: cdev lock_kernel() pushdown
phone_open() looks OK, but I don't trust the subsidiary drivers (and ixj in particular). Signed-off-by: Jonathan Corbet <corbet@lwn.net>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/telephony/phonedev.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/telephony/phonedev.c b/drivers/telephony/phonedev.c
index bcea8d9b718c..4d74ba36c3a1 100644
--- a/drivers/telephony/phonedev.c
+++ b/drivers/telephony/phonedev.c
@@ -23,6 +23,7 @@
#include <linux/errno.h>
#include <linux/phonedev.h>
#include <linux/init.h>
+#include <linux/smp_lock.h>
#include <asm/uaccess.h>
#include <asm/system.h>
@@ -53,6 +54,7 @@ static int phone_open(struct inode *inode, struct file *file)
if (minor >= PHONE_NUM_DEVICES)
return -ENODEV;
+ lock_kernel();
mutex_lock(&phone_lock);
p = phone_device[minor];
if (p)
@@ -79,6 +81,7 @@ static int phone_open(struct inode *inode, struct file *file)
fops_put(old_fops);
end:
mutex_unlock(&phone_lock);
+ unlock_kernel();
return err;
}