diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2009-10-29 08:56:17 -0600 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-11-09 16:22:18 -0800 |
commit | a8381266f673b5597f11fb9bad9ae196e9915f87 (patch) | |
tree | 4dc4a7324501ff8ad65d68c269c78b422742aff7 /kernel | |
parent | 9f00eee2ffab59cb85ecf1de54282c7fb4669565 (diff) |
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 <tiwai@suse.de>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'kernel')
-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 276fd63bc78..46c2fbbfb85 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; |