mirror of
https://github.com/adulau/aha.git
synced 2024-12-28 03:36:19 +00:00
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
This commit is contained in:
parent
65afac7d80
commit
d553ad864e
1 changed files with 1 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue