mirror of
https://github.com/genesi/linux-legacy.git
synced 2026-05-19 03:10:33 +00:00
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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
9f00eee2ff
commit
a8381266f6
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user