diff options
author | Jonathan Corbet <corbet@lwn.net> | 2008-05-16 09:10:50 -0600 |
---|---|---|
committer | Jonathan Corbet <corbet@lwn.net> | 2008-06-20 14:05:50 -0600 |
commit | 39d95b9d857ad9ed335dd1a2d6c6de1f1ee69ce1 (patch) | |
tree | a16394617563ac99600da266a679ca29e14fc644 /drivers/char | |
parent | c43ef17450dce8cbf50f97497a1949ff8f484e88 (diff) | |
download | op-kernel-dev-39d95b9d857ad9ed335dd1a2d6c6de1f1ee69ce1.zip op-kernel-dev-39d95b9d857ad9ed335dd1a2d6c6de1f1ee69ce1.tar.gz |
tty: cdev lock_kernel() pushdown
Parts of the serial code actually BUG() if we don't do this.
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/tty_io.c | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c index e94bee0..fd182f2 100644 --- a/drivers/char/tty_io.c +++ b/drivers/char/tty_io.c @@ -2665,7 +2665,7 @@ static void release_dev(struct file *filp) * ->siglock protects ->signal/->sighand */ -static int tty_open(struct inode *inode, struct file *filp) +static int __tty_open(struct inode *inode, struct file *filp) { struct tty_struct *tty; int noctty, retval; @@ -2779,6 +2779,19 @@ got_driver: return 0; } +/* BKL pushdown: scary code avoidance wrapper */ +static int tty_open(struct inode *inode, struct file *filp) +{ + int ret; + + lock_kernel(); + ret = __tty_open(inode, filp); + unlock_kernel(); + return ret; +} + + + #ifdef CONFIG_UNIX98_PTYS /** * ptmx_open - open a unix 98 pty master @@ -2792,7 +2805,7 @@ got_driver: * allocated_ptys_lock handles the list of free pty numbers */ -static int ptmx_open(struct inode *inode, struct file *filp) +static int __ptmx_open(struct inode *inode, struct file *filp) { struct tty_struct *tty; int retval; @@ -2831,6 +2844,16 @@ out: devpts_kill_index(index); return retval; } + +static int ptmx_open(struct inode *inode, struct file *filp) +{ + int ret; + + lock_kernel(); + ret = __ptmx_open(inode, filp); + unlock_kernel(); + return ret; +} #endif /** |