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

Commit faa2f98f authored by Li Zefan's avatar Li Zefan Committed by Ingo Molnar
Browse files

sched: add sanity check in partition_sched_domains()



Impact: cleanup, add debug check

It's wrong to make dattr_new = NULL if doms_new == NULL, it introduces
memory leak if dattr_new != NULL. Fortunately dattr_new is always NULL
in this case. So remove the code and add a sanity check.

Signed-off-by: default avatarLi Zefan <lizf@cn.fujitsu.com>
Acked-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
parent a17e2260
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -7767,7 +7767,7 @@ void partition_sched_domains(int ndoms_new, cpumask_t *doms_new,
		ndoms_cur = 0;
		doms_new = &fallback_doms;
		cpus_andnot(doms_new[0], cpu_online_map, cpu_isolated_map);
		dattr_new = NULL;
		WARN_ON_ONCE(dattr_new);
	}

	/* Build new domains */