mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] potential NULL deref in serial/core.c
@ 2002-10-23 19:02 Ben Collins
  2002-10-23 19:10 ` Ben Collins
  0 siblings, 1 reply; 2+ messages in thread
From: Ben Collins @ 2002-10-23 19:02 UTC (permalink / raw)
  To: linux-kernel

Not sure if it's supposed to be a BUG() for tty to be NULL, but it's
surely a bug to dereference it before checking for that.



--- drivers/serial/core.c~	2002-10-23 14:59:17.000000000 -0400
+++ drivers/serial/core.c	2002-10-23 14:59:42.000000000 -0400
@@ -472,10 +472,12 @@
 
 static void uart_put_char(struct tty_struct *tty, unsigned char ch)
 {
-	struct uart_info *info = tty->driver_data;
+	struct uart_info *info;
 
-	if (tty)
+	if (tty) {
+		info = tty->driver_data;
 		__uart_put_char(info->port, &info->xmit, ch);
+	}
 }
 
 static void uart_flush_chars(struct tty_struct *tty)

-- 
Debian     - http://www.debian.org/
Linux 1394 - http://www.linux1394.org/
Subversion - http://subversion.tigris.org/
Deqo       - http://www.deqo.com/

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

end of thread, other threads:[~2002-10-23 19:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-23 19:02 [PATCH] potential NULL deref in serial/core.c Ben Collins
2002-10-23 19:10 ` Ben Collins

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®