]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
hci_ath: Fix the mess in this driver
authorAlan Cox <alan@linux.intel.com>
Mon, 14 Feb 2011 16:28:18 +0000 (16:28 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 17 Feb 2011 20:03:53 +0000 (12:03 -0800)
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>
drivers/bluetooth/hci_ath.c

index 6a160c17ea943426b459e5a9ec8ad9000b5b5b8e..bd34406faaae087f30eff8bc34b19a7ffb0204d9 100644 (file)
@@ -51,32 +51,32 @@ struct ath_struct {
 
 static int ath_wakeup_ar3k(struct tty_struct *tty)
 {
-       struct termios settings;
-       int status = tty->driver->ops->tiocmget(tty, NULL);
+       struct ktermios ktermios;
+       int status = tty->driver->ops->tiocmget(tty);
 
        if (status & TIOCM_CTS)
                return status;
 
        /* Disable Automatic RTSCTS */
-       n_tty_ioctl_helper(tty, NULL, TCGETS, (unsigned long)&settings);
-       settings.c_cflag &= ~CRTSCTS;
-       n_tty_ioctl_helper(tty, NULL, TCSETS, (unsigned long)&settings);
+       memcpy(&ktermios, tty->termios, sizeof(ktermios));
+       ktermios.c_cflag &= ~CRTSCTS;
+       tty_set_termios(tty, &ktermios);
 
        /* Clear RTS first */
-       status = tty->driver->ops->tiocmget(tty, NULL);
-       tty->driver->ops->tiocmset(tty, NULL, 0x00, TIOCM_RTS);
+       status = tty->driver->ops->tiocmget(tty);
+       tty->driver->ops->tiocmset(tty, 0x00, TIOCM_RTS);
        mdelay(20);
 
        /* Set RTS, wake up board */
-       status = tty->driver->ops->tiocmget(tty, NULL);
-       tty->driver->ops->tiocmset(tty, NULL, TIOCM_RTS, 0x00);
+       status = tty->driver->ops->tiocmget(tty);
+       tty->driver->ops->tiocmset(tty, TIOCM_RTS, 0x00);
        mdelay(20);
 
-       status = tty->driver->ops->tiocmget(tty, NULL);
+       status = tty->driver->ops->tiocmget(tty);
 
-       n_tty_ioctl_helper(tty, NULL, TCGETS, (unsigned long)&settings);
-       settings.c_cflag |= CRTSCTS;
-       n_tty_ioctl_helper(tty, NULL, TCSETS, (unsigned long)&settings);
+       /* Disable Automatic RTSCTS */
+       ktermios.c_cflag |= CRTSCTS;
+       status = tty_set_termios(tty, &ktermios);
 
        return status;
 }