diff options
Diffstat (limited to 'drivers/char/tty_io.c')
-rw-r--r-- | drivers/char/tty_io.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c index 47a6eacb10bc..c57b1f434652 100644 --- a/drivers/char/tty_io.c +++ b/drivers/char/tty_io.c | |||
@@ -3324,10 +3324,8 @@ int tty_ioctl(struct inode * inode, struct file * file, | |||
3324 | * Nasty bug: do_SAK is being called in interrupt context. This can | 3324 | * Nasty bug: do_SAK is being called in interrupt context. This can |
3325 | * deadlock. We punt it up to process context. AKPM - 16Mar2001 | 3325 | * deadlock. We punt it up to process context. AKPM - 16Mar2001 |
3326 | */ | 3326 | */ |
3327 | static void __do_SAK(struct work_struct *work) | 3327 | void __do_SAK(struct tty_struct *tty) |
3328 | { | 3328 | { |
3329 | struct tty_struct *tty = | ||
3330 | container_of(work, struct tty_struct, SAK_work); | ||
3331 | #ifdef TTY_SOFT_SAK | 3329 | #ifdef TTY_SOFT_SAK |
3332 | tty_hangup(tty); | 3330 | tty_hangup(tty); |
3333 | #else | 3331 | #else |
@@ -3394,6 +3392,13 @@ static void __do_SAK(struct work_struct *work) | |||
3394 | #endif | 3392 | #endif |
3395 | } | 3393 | } |
3396 | 3394 | ||
3395 | static void do_SAK_work(struct work_struct *work) | ||
3396 | { | ||
3397 | struct tty_struct *tty = | ||
3398 | container_of(work, struct tty_struct, SAK_work); | ||
3399 | __do_SAK(tty); | ||
3400 | } | ||
3401 | |||
3397 | /* | 3402 | /* |
3398 | * The tq handling here is a little racy - tty->SAK_work may already be queued. | 3403 | * The tq handling here is a little racy - tty->SAK_work may already be queued. |
3399 | * Fortunately we don't need to worry, because if ->SAK_work is already queued, | 3404 | * Fortunately we don't need to worry, because if ->SAK_work is already queued, |
@@ -3404,7 +3409,7 @@ void do_SAK(struct tty_struct *tty) | |||
3404 | { | 3409 | { |
3405 | if (!tty) | 3410 | if (!tty) |
3406 | return; | 3411 | return; |
3407 | PREPARE_WORK(&tty->SAK_work, __do_SAK); | 3412 | PREPARE_WORK(&tty->SAK_work, do_SAK_work); |
3408 | schedule_work(&tty->SAK_work); | 3413 | schedule_work(&tty->SAK_work); |
3409 | } | 3414 | } |
3410 | 3415 | ||