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

Commit 915ef7bd authored by Vasily Gorbik's avatar Vasily Gorbik
Browse files

s390/numa: correct early_param handling



When command line options are used without specifying values
(e.g. "emu_size" instead of "emu_size="), the value is NULL. Check that
before performing string operations and further processing.

Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
parent 416f79c2
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -558,9 +558,7 @@ static int __init early_parse_emu_nodes(char *p)
{
	int count;

	if (kstrtoint(p, 0, &count) != 0 || count <= 0)
		return 0;
	if (count <= 0)
	if (!p || kstrtoint(p, 0, &count) != 0 || count <= 0)
		return 0;
	emu_nodes = min(count, MAX_NUMNODES);
	return 0;
@@ -572,6 +570,7 @@ early_param("emu_nodes", early_parse_emu_nodes);
 */
static int __init early_parse_emu_size(char *p)
{
	if (p)
		emu_size = memparse(p, NULL);
	return 0;
}
+2 −0
Original line number Diff line number Diff line
@@ -158,6 +158,8 @@ early_param("numa_debug", parse_debug);

static int __init parse_numa(char *parm)
{
	if (!parm)
		return 1;
	if (strcmp(parm, numa_mode_plain.name) == 0)
		mode = &numa_mode_plain;
#ifdef CONFIG_NUMA_EMU