diff options
author | Alan Cox <alan@lxorguk.ukuu.org.uk> | 2008-04-30 03:53:16 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-04-30 11:29:38 -0400 |
commit | 7b130c0efd7acbdc3cf9b2e7cc9a26e923feec93 (patch) | |
tree | c5d38927297ead7d4a337da767d279e1a5a5bf7f /drivers/char/cyclades.c | |
parent | e18ce49b5b8f957fb99d66990ff49d527f823210 (diff) |
cyclades: Prepare for relaxed locking in callers
Basically wrap it in lock_kernel where it is hard to prove the locking is
ok.
Signed-off-by: Alan Cox <alan@redhat.com>
Cc: "John Stoffel" <john@stoffel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/char/cyclades.c')
-rw-r--r-- | drivers/char/cyclades.c | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/drivers/char/cyclades.c b/drivers/char/cyclades.c index e4f579c3e245..23312f244545 100644 --- a/drivers/char/cyclades.c +++ b/drivers/char/cyclades.c | |||
@@ -3464,6 +3464,8 @@ static int cy_tiocmget(struct tty_struct *tty, struct file *file) | |||
3464 | if (serial_paranoia_check(info, tty->name, __FUNCTION__)) | 3464 | if (serial_paranoia_check(info, tty->name, __FUNCTION__)) |
3465 | return -ENODEV; | 3465 | return -ENODEV; |
3466 | 3466 | ||
3467 | lock_kernel(); | ||
3468 | |||
3467 | card = info->card; | 3469 | card = info->card; |
3468 | channel = info->line - card->first_line; | 3470 | channel = info->line - card->first_line; |
3469 | if (!IS_CYC_Z(*card)) { | 3471 | if (!IS_CYC_Z(*card)) { |
@@ -3506,10 +3508,12 @@ static int cy_tiocmget(struct tty_struct *tty, struct file *file) | |||
3506 | ((lstatus & C_RS_CTS) ? TIOCM_CTS : 0); | 3508 | ((lstatus & C_RS_CTS) ? TIOCM_CTS : 0); |
3507 | } else { | 3509 | } else { |
3508 | result = 0; | 3510 | result = 0; |
3511 | unlock_kernel(); | ||
3509 | return -ENODEV; | 3512 | return -ENODEV; |
3510 | } | 3513 | } |
3511 | 3514 | ||
3512 | } | 3515 | } |
3516 | unlock_kernel(); | ||
3513 | return result; | 3517 | return result; |
3514 | } /* cy_tiomget */ | 3518 | } /* cy_tiomget */ |
3515 | 3519 | ||
@@ -3880,6 +3884,7 @@ cy_ioctl(struct tty_struct *tty, struct file *file, | |||
3880 | printk(KERN_DEBUG "cyc:cy_ioctl ttyC%d, cmd = %x arg = %lx\n", | 3884 | printk(KERN_DEBUG "cyc:cy_ioctl ttyC%d, cmd = %x arg = %lx\n", |
3881 | info->line, cmd, arg); | 3885 | info->line, cmd, arg); |
3882 | #endif | 3886 | #endif |
3887 | lock_kernel(); | ||
3883 | 3888 | ||
3884 | switch (cmd) { | 3889 | switch (cmd) { |
3885 | case CYGETMON: | 3890 | case CYGETMON: |
@@ -3988,47 +3993,47 @@ cy_ioctl(struct tty_struct *tty, struct file *file, | |||
3988 | p_cuser = argp; | 3993 | p_cuser = argp; |
3989 | ret_val = put_user(cnow.cts, &p_cuser->cts); | 3994 | ret_val = put_user(cnow.cts, &p_cuser->cts); |
3990 | if (ret_val) | 3995 | if (ret_val) |
3991 | return ret_val; | 3996 | break; |
3992 | ret_val = put_user(cnow.dsr, &p_cuser->dsr); | 3997 | ret_val = put_user(cnow.dsr, &p_cuser->dsr); |
3993 | if (ret_val) | 3998 | if (ret_val) |
3994 | return ret_val; | 3999 | break; |
3995 | ret_val = put_user(cnow.rng, &p_cuser->rng); | 4000 | ret_val = put_user(cnow.rng, &p_cuser->rng); |
3996 | if (ret_val) | 4001 | if (ret_val) |
3997 | return ret_val; | 4002 | break; |
3998 | ret_val = put_user(cnow.dcd, &p_cuser->dcd); | 4003 | ret_val = put_user(cnow.dcd, &p_cuser->dcd); |
3999 | if (ret_val) | 4004 | if (ret_val) |
4000 | return ret_val; | 4005 | break; |
4001 | ret_val = put_user(cnow.rx, &p_cuser->rx); | 4006 | ret_val = put_user(cnow.rx, &p_cuser->rx); |
4002 | if (ret_val) | 4007 | if (ret_val) |
4003 | return ret_val; | 4008 | break; |
4004 | ret_val = put_user(cnow.tx, &p_cuser->tx); | 4009 | ret_val = put_user(cnow.tx, &p_cuser->tx); |
4005 | if (ret_val) | 4010 | if (ret_val) |
4006 | return ret_val; | 4011 | break; |
4007 | ret_val = put_user(cnow.frame, &p_cuser->frame); | 4012 | ret_val = put_user(cnow.frame, &p_cuser->frame); |
4008 | if (ret_val) | 4013 | if (ret_val) |
4009 | return ret_val; | 4014 | break; |
4010 | ret_val = put_user(cnow.overrun, &p_cuser->overrun); | 4015 | ret_val = put_user(cnow.overrun, &p_cuser->overrun); |
4011 | if (ret_val) | 4016 | if (ret_val) |
4012 | return ret_val; | 4017 | break; |
4013 | ret_val = put_user(cnow.parity, &p_cuser->parity); | 4018 | ret_val = put_user(cnow.parity, &p_cuser->parity); |
4014 | if (ret_val) | 4019 | if (ret_val) |
4015 | return ret_val; | 4020 | break; |
4016 | ret_val = put_user(cnow.brk, &p_cuser->brk); | 4021 | ret_val = put_user(cnow.brk, &p_cuser->brk); |
4017 | if (ret_val) | 4022 | if (ret_val) |
4018 | return ret_val; | 4023 | break; |
4019 | ret_val = put_user(cnow.buf_overrun, &p_cuser->buf_overrun); | 4024 | ret_val = put_user(cnow.buf_overrun, &p_cuser->buf_overrun); |
4020 | if (ret_val) | 4025 | if (ret_val) |
4021 | return ret_val; | 4026 | break; |
4022 | ret_val = 0; | 4027 | ret_val = 0; |
4023 | break; | 4028 | break; |
4024 | default: | 4029 | default: |
4025 | ret_val = -ENOIOCTLCMD; | 4030 | ret_val = -ENOIOCTLCMD; |
4026 | } | 4031 | } |
4032 | unlock_kernel(); | ||
4027 | 4033 | ||
4028 | #ifdef CY_DEBUG_OTHER | 4034 | #ifdef CY_DEBUG_OTHER |
4029 | printk(KERN_DEBUG "cyc:cy_ioctl done\n"); | 4035 | printk(KERN_DEBUG "cyc:cy_ioctl done\n"); |
4030 | #endif | 4036 | #endif |
4031 | |||
4032 | return ret_val; | 4037 | return ret_val; |
4033 | } /* cy_ioctl */ | 4038 | } /* cy_ioctl */ |
4034 | 4039 | ||