Commit a8381266 authored by Rusty Russell's avatar Rusty Russell Committed by Greg Kroah-Hartman

param: fix NULL comparison on oom

commit d553ad86 upstream.

kp->arg is always true: it's the contents of that pointer we care about.
Reported-by: default avatarTakashi Iwai <tiwai@suse.de>
Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 9f00eee2
......@@ -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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment