]> git.karo-electronics.de Git - karo-tx-linux.git/commit
serial: access after NULL check in uart_flush_buffer()
authorTetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Thu, 8 May 2008 21:06:17 +0000 (21:06 +0000)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 15 May 2008 14:49:59 +0000 (07:49 -0700)
commit2a57a7ee4005e63d1239b349aa8167093d93a11f
tree9e8c386d4097c6f97e139684f14b415786da4000
parent7075314222eeb1adb2a16dbab88c3534d72cc50b
serial: access after NULL check in uart_flush_buffer()

commit 55d7b68996a5064f011d681bca412b6281d2f711 upstream

I noticed that

  static void uart_flush_buffer(struct tty_struct *tty)
  {
   struct uart_state *state = tty->driver_data;
   struct uart_port *port = state->port;
   unsigned long flags;

   /*
    * This means you called this function _after_ the port was
    * closed.  No cookie for you.
    */
   if (!state || !state->info) {
   WARN_ON(1);
   return;
   }

is too late for checking state != NULL.

Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/serial/serial_core.c