Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d553ad86 authored by Rusty Russell's avatar Rusty Russell
Browse files

param: fix NULL comparison on oom



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>
Cc: stable@kernel.org
parent 65afac7d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;