aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/telephony
diff options
context:
space:
mode:
authorJonathan Corbet <corbet@lwn.net>2008-05-15 13:58:31 -0400
committerJonathan Corbet <corbet@lwn.net>2008-06-20 16:05:48 -0400
commit16750c2f32e3fd879fce787a13900f11633ef9af (patch)
tree5fe0c4fff83d764f1ca4e41dc23462bb0671b150 /drivers/telephony
parent70ffa16e604bab22b12bf72cb7796f1dd01ec335 (diff)
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/telephony')
-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 bcea8d9b718..4d74ba36c3a 100644
--- a/drivers/telephony/phonedev.c
+++ b/drivers/telephony/phonedev.c
@@ -23,6 +23,7 @@
23#include <linux/errno.h> 23#include <linux/errno.h>
24#include <linux/phonedev.h> 24#include <linux/phonedev.h>
25#include <linux/init.h> 25#include <linux/init.h>
26#include <linux/smp_lock.h>
26#include <asm/uaccess.h> 27#include <asm/uaccess.h>
27#include <asm/system.h> 28#include <asm/system.h>
28 29
@@ -53,6 +54,7 @@ static int phone_open(struct inode *inode, struct file *file)
53 if (minor >= PHONE_NUM_DEVICES) 54 if (minor >= PHONE_NUM_DEVICES)
54 return -ENODEV; 55 return -ENODEV;
55 56
57 lock_kernel();
56 mutex_lock(&phone_lock); 58 mutex_lock(&phone_lock);
57 p = phone_device[minor]; 59 p = phone_device[minor];
58 if (p) 60 if (p)
@@ -79,6 +81,7 @@ static int phone_open(struct inode *inode, struct file *file)
79 fops_put(old_fops); 81 fops_put(old_fops);
80end: 82end:
81 mutex_unlock(&phone_lock); 83 mutex_unlock(&phone_lock);
84 unlock_kernel();
82 return err; 85 return err;
83} 86}
84 87