aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2010-06-04 18:23:07 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2010-06-04 18:23:07 -0400
commitbf4282cbcf7f53c23e87fb0cef945591cdc8d631 (patch)
treece1844209ec623c1ed661405ffd8f8f37a319aa8 /drivers/char
parentd7940b04fa441b06b69f05faef43c5fb2156ab72 (diff)
parent66169ad17d9c67a33608830dd83dcef55c85a756 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty-2.6: serial: add support for various Titan PCI cards vt_ioctl: return -EFAULT on copy_from_user errors serial: altera_uart: Proper section for altera_uart_remove tty: fix a little bug in scrup, vt.c altera_uart: Simplify altera_uart_console_putc altera_uart: Don't take spinlock in already protected functions TTY/n_gsm: potential double lock serial: bfin_5xx: fix typo in IER check serial: bfin_5xx: IRDA is not affected by anomaly 05000230 serial_cs: add and sort IDs for serial and modem cards msm_serial: fix serial on trout
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/n_gsm.c9
-rw-r--r--drivers/char/vt.c2
-rw-r--r--drivers/char/vt_ioctl.c4
3 files changed, 9 insertions, 6 deletions
diff --git a/drivers/char/n_gsm.c b/drivers/char/n_gsm.c
index c4161d5e053d..e4089c432f15 100644
--- a/drivers/char/n_gsm.c
+++ b/drivers/char/n_gsm.c
@@ -904,9 +904,7 @@ static void gsm_dlci_data_sweep(struct gsm_mux *gsm)
904 int len; 904 int len;
905 /* Priority ordering: We should do priority with RR of the groups */ 905 /* Priority ordering: We should do priority with RR of the groups */
906 int i = 1; 906 int i = 1;
907 unsigned long flags;
908 907
909 spin_lock_irqsave(&gsm->tx_lock, flags);
910 while (i < NUM_DLCI) { 908 while (i < NUM_DLCI) {
911 struct gsm_dlci *dlci; 909 struct gsm_dlci *dlci;
912 910
@@ -927,7 +925,6 @@ static void gsm_dlci_data_sweep(struct gsm_mux *gsm)
927 if (len == 0) 925 if (len == 0)
928 i++; 926 i++;
929 } 927 }
930 spin_unlock_irqrestore(&gsm->tx_lock, flags);
931} 928}
932 929
933/** 930/**
@@ -2230,12 +2227,16 @@ static int gsmld_open(struct tty_struct *tty)
2230static void gsmld_write_wakeup(struct tty_struct *tty) 2227static void gsmld_write_wakeup(struct tty_struct *tty)
2231{ 2228{
2232 struct gsm_mux *gsm = tty->disc_data; 2229 struct gsm_mux *gsm = tty->disc_data;
2230 unsigned long flags;
2233 2231
2234 /* Queue poll */ 2232 /* Queue poll */
2235 clear_bit(TTY_DO_WRITE_WAKEUP, &tty->flags); 2233 clear_bit(TTY_DO_WRITE_WAKEUP, &tty->flags);
2236 gsm_data_kick(gsm); 2234 gsm_data_kick(gsm);
2237 if (gsm->tx_bytes < TX_THRESH_LO) 2235 if (gsm->tx_bytes < TX_THRESH_LO) {
2236 spin_lock_irqsave(&gsm->tx_lock, flags);
2238 gsm_dlci_data_sweep(gsm); 2237 gsm_dlci_data_sweep(gsm);
2238 spin_unlock_irqrestore(&gsm->tx_lock, flags);
2239 }
2239} 2240}
2240 2241
2241/** 2242/**
diff --git a/drivers/char/vt.c b/drivers/char/vt.c
index 7cdb6ee569cd..1296c42ed5c6 100644
--- a/drivers/char/vt.c
+++ b/drivers/char/vt.c
@@ -304,7 +304,7 @@ static void scrup(struct vc_data *vc, unsigned int t, unsigned int b, int nr)
304 d = (unsigned short *)(vc->vc_origin + vc->vc_size_row * t); 304 d = (unsigned short *)(vc->vc_origin + vc->vc_size_row * t);
305 s = (unsigned short *)(vc->vc_origin + vc->vc_size_row * (t + nr)); 305 s = (unsigned short *)(vc->vc_origin + vc->vc_size_row * (t + nr));
306 scr_memmovew(d, s, (b - t - nr) * vc->vc_size_row); 306 scr_memmovew(d, s, (b - t - nr) * vc->vc_size_row);
307 scr_memsetw(d + (b - t - nr) * vc->vc_cols, vc->vc_video_erase_char, 307 scr_memsetw(d + (b - t - nr) * vc->vc_size_row, vc->vc_video_erase_char,
308 vc->vc_size_row * nr); 308 vc->vc_size_row * nr);
309} 309}
310 310
diff --git a/drivers/char/vt_ioctl.c b/drivers/char/vt_ioctl.c
index 6aa10284104a..cb19dbc52136 100644
--- a/drivers/char/vt_ioctl.c
+++ b/drivers/char/vt_ioctl.c
@@ -1303,7 +1303,9 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
1303 if (!perm) 1303 if (!perm)
1304 goto eperm; 1304 goto eperm;
1305 ret = copy_from_user(&ui, up, sizeof(struct unimapinit)); 1305 ret = copy_from_user(&ui, up, sizeof(struct unimapinit));
1306 if (!ret) 1306 if (ret)
1307 ret = -EFAULT;
1308 else
1307 con_clear_unimap(vc, &ui); 1309 con_clear_unimap(vc, &ui);
1308 break; 1310 break;
1309 } 1311 }