提交 d553ad86 编写于 作者: R Rusty Russell

param: fix NULL comparison on oom

kp->arg is always true: it's the contents of that pointer we care about.
Reported-by: NTakashi Iwai <tiwai@suse.de>
Signed-off-by: NRusty Russell <rusty@rustcorp.com.au>
Cc: stable@kernel.org
上级 65afac7d
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册