From: Rusty Russell Date: Thu, 29 Oct 2009 14:56:17 +0000 (-0600) Subject: param: fix NULL comparison on oom X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=d553ad864e3b3dde3f1038d491e207021b2d6293;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 95ef27cf8e82..00520c43d88c 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;