aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/bluetooth
diff options
context:
space:
mode:
authorAlan Cox <alan@linux.intel.com>2011-02-14 11:28:18 -0500
committerGreg Kroah-Hartman <gregkh@suse.de>2011-02-17 15:03:53 -0500
commitafaae08442d86402f9e0b63475c02a651c6f1387 (patch)
tree2f2845b4de1491b308079ee230504d1d5afbff67 /drivers/bluetooth
parent8d075b199b9a66ad90296f898f1f15c0ae1511b8 (diff)
hci_ath: Fix the mess in this driver
Was this exploitable - who knows, but it was certainly totally broken Signed-of-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/bluetooth')
-rw-r--r--drivers/bluetooth/hci_ath.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/drivers/bluetooth/hci_ath.c b/drivers/bluetooth/hci_ath.c
index 6a160c17ea94..bd34406faaae 100644
--- a/drivers/bluetooth/hci_ath.c
+++ b/drivers/bluetooth/hci_ath.c
@@ -51,32 +51,32 @@ struct ath_struct {
51 51
52static int ath_wakeup_ar3k(struct tty_struct *tty) 52static int ath_wakeup_ar3k(struct tty_struct *tty)
53{ 53{
54 struct termios settings; 54 struct ktermios ktermios;
55 int status = tty->driver->ops->tiocmget(tty, NULL); 55 int status = tty->driver->ops->tiocmget(tty);
56 56
57 if (status & TIOCM_CTS) 57 if (status & TIOCM_CTS)
58 return status; 58 return status;
59 59
60 /* Disable Automatic RTSCTS */ 60 /* Disable Automatic RTSCTS */
61 n_tty_ioctl_helper(tty, NULL, TCGETS, (unsigned long)&settings); 61 memcpy(&ktermios, tty->termios, sizeof(ktermios));
62 settings.c_cflag &= ~CRTSCTS; 62 ktermios.c_cflag &= ~CRTSCTS;
63 n_tty_ioctl_helper(tty, NULL, TCSETS, (unsigned long)&settings); 63 tty_set_termios(tty, &ktermios);
64 64
65 /* Clear RTS first */ 65 /* Clear RTS first */
66 status = tty->driver->ops->tiocmget(tty, NULL); 66 status = tty->driver->ops->tiocmget(tty);
67 tty->driver->ops->tiocmset(tty, NULL, 0x00, TIOCM_RTS); 67 tty->driver->ops->tiocmset(tty, 0x00, TIOCM_RTS);
68 mdelay(20); 68 mdelay(20);
69 69
70 /* Set RTS, wake up board */ 70 /* Set RTS, wake up board */
71 status = tty->driver->ops->tiocmget(tty, NULL); 71 status = tty->driver->ops->tiocmget(tty);
72 tty->driver->ops->tiocmset(tty, NULL, TIOCM_RTS, 0x00); 72 tty->driver->ops->tiocmset(tty, TIOCM_RTS, 0x00);
73 mdelay(20); 73 mdelay(20);
74 74
75 status = tty->driver->ops->tiocmget(tty, NULL); 75 status = tty->driver->ops->tiocmget(tty);
76 76
77 n_tty_ioctl_helper(tty, NULL, TCGETS, (unsigned long)&settings); 77 /* Disable Automatic RTSCTS */
78 settings.c_cflag |= CRTSCTS; 78 ktermios.c_cflag |= CRTSCTS;
79 n_tty_ioctl_helper(tty, NULL, TCSETS, (unsigned long)&settings); 79 status = tty_set_termios(tty, &ktermios);
80 80
81 return status; 81 return status;
82} 82}