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.31.6~64 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=a8381266f673b5597f11fb9bad9ae196e9915f87;p=karo-tx-linux.git param: fix NULL comparison on oom commit d553ad864e3b3dde3f1038d491e207021b2d6293 upstream. kp->arg is always true: it's the contents of that pointer we care about. Reported-by: Takashi Iwai Signed-off-by: Rusty Russell Signed-off-by: Greg Kroah-Hartman --- diff --git a/kernel/params.c b/kernel/params.c index 276fd63bc780..46c2fbbfb85f 100644 --- a/kernel/params.c +++ b/kernel/params.c @@ -221,7 +221,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;