linux-um archives
 help / color / mirror / Atom feed
From: Frank Sorenson <frank@tuxrocks.com>
To: UML Devel <user-mode-linux-devel@lists.sourceforge.net>
Subject: [uml-devel] [PATCH] Put the check for NULL before the use of a potentially-null value
Date: Mon, 10 Jan 2005 14:52:12 -0700	[thread overview]
Message-ID: <41E2F90C.4020707@tuxrocks.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 335 bytes --]

This patch reorders two lines to check a variable for NULL before using 
the variable.

Signed-off-by: Frank Sorenson <frank@tuxrocks.com>

Frank
---------------------------------------------------------------------------
Frank Sorenson - KD7TZK
Systems Manager, Computer Science Department
Brigham Young University
frank@tuxrocks.com

[-- Attachment #2: reorder_null_check --]
[-- Type: text/plain, Size: 483 bytes --]

diff -Naur linux-2.6.10-mm2.orig/arch/um/drivers/line.c linux-2.6.10-mm2/arch/um/drivers/line.c
--- linux-2.6.10-mm2.orig/arch/um/drivers/line.c	2005-01-10 14:35:20.379815252 -0700
+++ linux-2.6.10-mm2/arch/um/drivers/line.c	2005-01-10 14:35:59.786829555 -0700
@@ -593,8 +593,8 @@
 		}
 	}
 	tty  = winch->tty;
-	line = tty->driver_data;
 	if (tty != NULL) {
+		line = tty->driver_data;
 		chan_window_size(&line->chan_list,
 				 &tty->winsize.ws_row, 
 				 &tty->winsize.ws_col);

             reply	other threads:[~2005-01-10 21:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-10 21:52 Frank Sorenson [this message]
2005-01-11  0:28 ` [uml-devel] [PATCH] Put the check for NULL before the use of a potentially-null value Blaisorblade
2005-01-11  1:06   ` Frank Sorenson
2005-01-11  9:13   ` Gerd Knorr

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=41E2F90C.4020707@tuxrocks.com \
    --to=frank@tuxrocks.com \
    --cc=user-mode-linux-devel@lists.sourceforge.net \
    /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