lkml.org 
[lkml]   [2009]   [Nov]   [6]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
DateFri, 06 Nov 2009 14:14:35 -0800
FromGreg KH <>
Subject[37/99] param: fix NULL comparison on oom
2.6.31-stable review patch.  If anyone has any objections, please let us know.

------------------
From: Rusty Russell <rusty@rustcorp.com.au>
commit d553ad864e3b3dde3f1038d491e207021b2d6293 upstream.

kp->arg is always true: it's the contents of that pointer we care about.

Reported-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
kernel/params.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- a/kernel/params.c
+++ b/kernel/params.c
@@ -221,7 +221,7 @@ int param_set_charp(const char *val, str
* don't need to; this mangled commandline is preserved. */
if (slab_is_available()) {
*(char **)kp->arg = kstrdup(val, GFP_KERNEL);
- if (!kp->arg)
+ if (!*(char **)kp->arg)
return -ENOMEM;
} else
*(const char **)kp->arg = val;



\
 
 \ /
  Last update: 2009-11-06 23:55    [W:0.867 / U:0.020 seconds]
©2003-2009 Jasper Spaans