diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2009-10-29 08:56:17 -0600 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2009-10-29 08:56:18 +1030 |
commit | d553ad864e3b3dde3f1038d491e207021b2d6293 (patch) | |
tree | 2a6d4e482e72daf6056e1fb984407754e019f15a /kernel/params.c | |
parent | 65afac7d80ab3bc9f81e75eafb71eeb92a3ebdef (diff) | |
download | linux-stable-d553ad864e3b3dde3f1038d491e207021b2d6293.tar.gz linux-stable-d553ad864e3b3dde3f1038d491e207021b2d6293.tar.bz2 linux-stable-d553ad864e3b3dde3f1038d491e207021b2d6293.zip |
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 <tiwai@suse.de>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Cc: stable@kernel.org
Diffstat (limited to 'kernel/params.c')
-rw-r--r-- | kernel/params.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; |