From: Dan Carpenter <dan.carpenter@oracle.com>
To: jslaby@suse.cz
Cc: linux-serial@vger.kernel.org
Subject: re: TTY: switch tty_insert_flip_char
Date: Mon, 16 Dec 2013 12:44:10 +0300 [thread overview]
Message-ID: <20131216094410.GA13831@elgon.mountain> (raw)
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
reply other threads:[~2013-12-16 9:44 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20131216094410.GA13831@elgon.mountain \
--to=dan.carpenter@oracle.com \
--cc=jslaby@suse.cz \
--cc=linux-serial@vger.kernel.org \
/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 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).