mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] Possible null pointer in drivers/serial/core.c
@ 2002-10-09 18:17 Paul Larson
  0 siblings, 0 replies; only message in thread
From: Paul Larson @ 2002-10-09 18:17 UTC (permalink / raw)
  To: tytso, lkml

In core.c:uart_startup() line 210 I found a possible null pointer
dereference at line 210:
 if (info->tty->termios->c_cflag & CBAUD)

There are other things around that same area that do the checking for
info->tty before dereferencing it, so either they are unneeded, or this
one needs a check too.

Thanks,
Paul Larson
--------------------
--- linux-2.5/drivers/serial/core.c	Wed Oct  9 13:45:11 2002
+++ linux-corefix/drivers/serial/core.c	Wed Oct  9 13:50:09 2002
@@ -207,7 +207,7 @@
 			 * Setup the RTS and DTR signals once the
 			 * port is open and ready to respond.
 			 */
-			if (info->tty->termios->c_cflag & CBAUD)
+			if (info->tty && (info->tty->termios->c_cflag & CBAUD))
 				uart_set_mctrl(port, TIOCM_RTS | TIOCM_DTR);
 		}
 


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-10-09 18:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-09 18:17 [PATCH] Possible null pointer in drivers/serial/core.c Paul Larson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®