[37/99] param: fix NULL comparison on oom

From: Greg KH
Date: Fri Nov 06 2009 - 17:38:21 EST


2.6.31-stable review patch. If anyone has any objections, please let us know.

------------------
From: Rusty Russell <rusty@xxxxxxxxxxxxxxx>

commit d553ad864e3b3dde3f1038d491e207021b2d6293 upstream.

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

Reported-by: Takashi Iwai <tiwai@xxxxxxx>
Signed-off-by: Rusty Russell <rusty@xxxxxxxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx>

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


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/