All of lore.kernel.org
 help / color / mirror / Atom feed
* [uml-devel] [PATCH] Put the check for NULL before the use of a potentially-null value
@ 2005-01-10 21:52 Frank Sorenson
  2005-01-11  0:28 ` Blaisorblade
  0 siblings, 1 reply; 4+ messages in thread
From: Frank Sorenson @ 2005-01-10 21:52 UTC (permalink / raw)
  To: UML Devel

[-- 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);

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

* Re: [uml-devel] [PATCH] Put the check for NULL before the use of a potentially-null value
  2005-01-10 21:52 [uml-devel] [PATCH] Put the check for NULL before the use of a potentially-null value Frank Sorenson
@ 2005-01-11  0:28 ` Blaisorblade
  2005-01-11  1:06   ` Frank Sorenson
  2005-01-11  9:13   ` Gerd Knorr
  0 siblings, 2 replies; 4+ messages in thread
From: Blaisorblade @ 2005-01-11  0:28 UTC (permalink / raw)
  To: user-mode-linux-devel, Frank Sorenson, Gerd Knorr

On Monday 10 January 2005 22:52, Frank Sorenson wrote:
> This patch reorders two lines to check a variable for NULL before using
> the variable.
>
> Signed-off-by: Frank Sorenson <frank@tuxrocks.com>

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);

Ok, correct and thanks a lot.

Sorry, a little question: against what tree does it apply?

I cannot apply it locally, but I see that it should apply on top of Gerd 
Knorr's terminal cleanup patch, which introduces the bug.

I hope I'll not forget it...
-- 
Paolo Giarrusso, aka Blaisorblade
Linux registered user n. 292729
http://www.user-mode-linux.org/~blaisorblade


-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

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

* Re: [uml-devel] [PATCH] Put the check for NULL before the use of a potentially-null value
  2005-01-11  0:28 ` Blaisorblade
@ 2005-01-11  1:06   ` Frank Sorenson
  2005-01-11  9:13   ` Gerd Knorr
  1 sibling, 0 replies; 4+ messages in thread
From: Frank Sorenson @ 2005-01-11  1:06 UTC (permalink / raw)
  To: Blaisorblade; +Cc: user-mode-linux-devel, Gerd Knorr

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Blaisorblade wrote:
| On Monday 10 January 2005 22:52, Frank Sorenson wrote:
|
|>This patch reorders two lines to check a variable for NULL before using
|>the variable.

| Ok, correct and thanks a lot.
|
| Sorry, a little question: against what tree does it apply?
|
| I cannot apply it locally, but I see that it should apply on top of Gerd
| Knorr's terminal cleanup patch, which introduces the bug.
|
| I hope I'll not forget it...

It should apply against 2.6.10-mm2 (uml-terminal-cleanup went into -mm2)
or anything after (looks like I did the diff from after Jeff Dike's
recent slew of patches).

Frank
- --
Frank Sorenson - KD7TZK
Systems Manager, Computer Science Department
Brigham Young University
frank@tuxrocks.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFB4yacaI0dwg4A47wRAhVGAJsFq+onMrDEOI/1CGPFN6UJNxgi7wCfUT33
FoV3BzZkwxG9h8himxPZ+sw=
=I+np
-----END PGP SIGNATURE-----


-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

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

* Re: [uml-devel] [PATCH] Put the check for NULL before the use of a potentially-null value
  2005-01-11  0:28 ` Blaisorblade
  2005-01-11  1:06   ` Frank Sorenson
@ 2005-01-11  9:13   ` Gerd Knorr
  1 sibling, 0 replies; 4+ messages in thread
From: Gerd Knorr @ 2005-01-11  9:13 UTC (permalink / raw)
  To: Blaisorblade; +Cc: user-mode-linux-devel, Frank Sorenson

> -       line = tty->driver_data;
>         if (tty != NULL) {
> +               line = tty->driver_data;

> Sorry, a little question: against what tree does it apply?

Any cutting edge tree (both latest -mm and latest Linus -bk snapshot).

> I hope I'll not forget it...

I think it can go to andrew morton as-is, it's a ObviouslyCorrect[tm] fix.

  Gerd

-- 
#define printk(args...) fprintf(stderr, ## args)



-------------------------------------------------------
The SF.Net email is sponsored by: Beat the post-holiday blues
Get a FREE limited edition SourceForge.net t-shirt from ThinkGeek.
It's fun and FREE -- well, almost....http://www.thinkgeek.com/sfshirt
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

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

end of thread, other threads:[~2005-01-11  9:40 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-10 21:52 [uml-devel] [PATCH] Put the check for NULL before the use of a potentially-null value Frank Sorenson
2005-01-11  0:28 ` Blaisorblade
2005-01-11  1:06   ` Frank Sorenson
2005-01-11  9:13   ` Gerd Knorr

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.