All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: Tobias Klauser <tklauser@distanz.ch>
Cc: linux-serial@vger.kernel.org, nios2-dev@sopc.et.ntust.edu.tw
Subject: [smatch stuff] altera_uart: inconsistent checks for null
Date: Sat, 19 Feb 2011 12:31:07 +0300	[thread overview]
Message-ID: <20110219093107.GC4384@bicker> (raw)

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

             reply	other threads:[~2011-02-19  9:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-19  9:31 Dan Carpenter [this message]
2011-02-19 13:22 ` [smatch stuff] altera_uart: inconsistent checks for null Tobias Klauser
2011-02-19 14:02   ` Dan Carpenter
2011-03-01  8:10     ` Tobias Klauser

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110219093107.GC4384@bicker \
    --to=error27@gmail.com \
    --cc=linux-serial@vger.kernel.org \
    --cc=nios2-dev@sopc.et.ntust.edu.tw \
    --cc=tklauser@distanz.ch \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.