* re: TTY: switch tty_insert_flip_char
@ 2013-12-16 9:44 Dan Carpenter
0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2013-12-16 9:44 UTC (permalink / raw)
To: jslaby; +Cc: linux-serial
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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2013-12-16 9:44 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-12-16 9:44 TTY: switch tty_insert_flip_char Dan Carpenter
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.