提交 16750c2f 编写于 作者: J Jonathan Corbet

phonedev: cdev lock_kernel() pushdown

phone_open() looks OK, but I don't trust the subsidiary drivers (and ixj in
particular).
Signed-off-by: NJonathan Corbet <corbet@lwn.net>
上级 70ffa16e
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册