From: Rusty Russell Date: Thu, 29 Oct 2009 14:56:17 +0000 (-0600) Subject: param: fix NULL comparison on oom X-Git-Tag: v2.6.32-rc6~34^2~1 X-Git-Url: http://ftp.safe.ca/?p=safe%2Fjmp%2Flinux-2.6;a=commitdiff_plain;h=d553ad864e3b3dde3f1038d491e207021b2d6293 param: fix NULL comparison on oom kp->arg is always true: it's the contents of that pointer we care about. Reported-by: Takashi Iwai Signed-off-by: Rusty Russell Cc: stable@kernel.org --- diff --git a/kernel/params.c b/kernel/params.c index 95ef27c..00520c4 100644 --- a/kernel/params.c +++ b/kernel/params.c @@ -222,7 +222,7 @@ int param_set_charp(const char *val, struct kernel_param *kp) * 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;