re: TTY: switch tty_insert_flip_char

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Jiri Slaby,

The patch 92a19f9cec9a: "TTY: switch tty_insert_flip_char" from
Jan 3, 2013, leads to the following static checker warning:
	drivers/tty/serial/sc26xx.c:189 receive_chars()
	error: potential NULL dereference 'tport'.

drivers/tty/serial/sc26xx.c
   139  static bool receive_chars(struct uart_port *port)
   140  {
   141          struct tty_port *tport = NULL;
   142          int limit = 10000;
   143          unsigned char ch;
   144          char flag;
   145          u8 status;
   146  
   147          /* FIXME what is this trying to achieve? */
   148          if (port->state != NULL)                /* Unopened serial console */
   149                  tport = &port->state->port;

"tport" can be NULL if port->state is NULL.  It's not clear if this is
actually possible.

   150  

[ snip ]

   182  
   183                  if (uart_handle_sysrq_char(port, ch))
   184                          continue;
   185  
   186                  if (status & port->ignore_status_mask)
   187                          continue;
   188  
   189                  tty_insert_flip_char(tport, ch, flag);
   190          }
   191          return !!tport;


regards,
dan carpenter

--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux