linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [smatch stuff] altera_uart: inconsistent checks for null
@ 2011-02-19  9:31 Dan Carpenter
  2011-02-19 13:22 ` Tobias Klauser
  0 siblings, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2011-02-19  9:31 UTC (permalink / raw)
  To: Tobias Klauser; +Cc: linux-serial, nios2-dev

Hi Tobias,

Patch 2780ad42f5fe67 "tty: serial: altera_uart: Use port->regshift to
store bus shift" added a NULL check for platp in altera_uart_probe() but
not consistently through out the function.

drivers/tty/serial/altera_uart.c +553 altera_uart_probe(43)
	error: we previously assumed 'platp' could be null.

   545          if (platp)
                   ^^^^^^^
checked here.

   546                  port->regshift = platp->bus_shift;
   547          else
   548                  port->regshift = 0;
   549
   550          port->line = i;
   551          port->type = PORT_ALTERA_UART;
   552          port->iotype = SERIAL_IO_MEM;
   553          port->uartclk = platp->uartclk;
                                ^^^^^^^
potential NULL dereference?

   554          port->ops = &altera_uart_ops;

I don't know the right way to address this.

regards,
dan carpenter

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-03-01  8:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-19  9:31 [smatch stuff] altera_uart: inconsistent checks for null Dan Carpenter
2011-02-19 13:22 ` Tobias Klauser
2011-02-19 14:02   ` Dan Carpenter
2011-03-01  8:10     ` Tobias Klauser

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).