Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 95157
b: refs/heads/master
c: 7b130c0
h: refs/heads/master
i:
  95155: e37e313
v: v3
  • Loading branch information
Alan Cox authored and Linus Torvalds committed Apr 30, 2008
1 parent f33eb28 commit e0173b5
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e18ce49b5b8f957fb99d66990ff49d527f823210
refs/heads/master: 7b130c0efd7acbdc3cf9b2e7cc9a26e923feec93
29 changes: 17 additions & 12 deletions trunk/drivers/char/cyclades.c
Original file line number Diff line number Diff line change
Expand Up @@ -3464,6 +3464,8 @@ static int cy_tiocmget(struct tty_struct *tty, struct file *file)
if (serial_paranoia_check(info, tty->name, __FUNCTION__))
return -ENODEV;

lock_kernel();

card = info->card;
channel = info->line - card->first_line;
if (!IS_CYC_Z(*card)) {
Expand Down Expand Up @@ -3506,10 +3508,12 @@ static int cy_tiocmget(struct tty_struct *tty, struct file *file)
((lstatus & C_RS_CTS) ? TIOCM_CTS : 0);
} else {
result = 0;
unlock_kernel();
return -ENODEV;
}

}
unlock_kernel();
return result;
} /* cy_tiomget */

Expand Down Expand Up @@ -3880,6 +3884,7 @@ cy_ioctl(struct tty_struct *tty, struct file *file,
printk(KERN_DEBUG "cyc:cy_ioctl ttyC%d, cmd = %x arg = %lx\n",
info->line, cmd, arg);
#endif
lock_kernel();

switch (cmd) {
case CYGETMON:
Expand Down Expand Up @@ -3988,47 +3993,47 @@ cy_ioctl(struct tty_struct *tty, struct file *file,
p_cuser = argp;
ret_val = put_user(cnow.cts, &p_cuser->cts);
if (ret_val)
return ret_val;
break;
ret_val = put_user(cnow.dsr, &p_cuser->dsr);
if (ret_val)
return ret_val;
break;
ret_val = put_user(cnow.rng, &p_cuser->rng);
if (ret_val)
return ret_val;
break;
ret_val = put_user(cnow.dcd, &p_cuser->dcd);
if (ret_val)
return ret_val;
break;
ret_val = put_user(cnow.rx, &p_cuser->rx);
if (ret_val)
return ret_val;
break;
ret_val = put_user(cnow.tx, &p_cuser->tx);
if (ret_val)
return ret_val;
break;
ret_val = put_user(cnow.frame, &p_cuser->frame);
if (ret_val)
return ret_val;
break;
ret_val = put_user(cnow.overrun, &p_cuser->overrun);
if (ret_val)
return ret_val;
break;
ret_val = put_user(cnow.parity, &p_cuser->parity);
if (ret_val)
return ret_val;
break;
ret_val = put_user(cnow.brk, &p_cuser->brk);
if (ret_val)
return ret_val;
break;
ret_val = put_user(cnow.buf_overrun, &p_cuser->buf_overrun);
if (ret_val)
return ret_val;
break;
ret_val = 0;
break;
default:
ret_val = -ENOIOCTLCMD;
}
unlock_kernel();

#ifdef CY_DEBUG_OTHER
printk(KERN_DEBUG "cyc:cy_ioctl done\n");
#endif

return ret_val;
} /* cy_ioctl */

Expand Down

0 comments on commit e0173b5

Please sign in to comment.