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

Commit e7bbcdf3 authored by Dan Carpenter's avatar Dan Carpenter Committed by Linus Torvalds
Browse files

memcontrol: fix potential null deref



There was a potential null deref introduced in c62b1a3b ("memcg: use
generic percpu instead of private implementation").

Signed-off-by: default avatarDan Carpenter <error27@gmail.com>
Acked-by: default avatarKAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 9d34706f
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -3691,7 +3691,9 @@ static struct mem_cgroup *mem_cgroup_alloc(void)
	else
		mem = vmalloc(size);

	if (mem)
	if (!mem)
		return NULL;

	memset(mem, 0, size);
	mem->stat = alloc_percpu(struct mem_cgroup_stat_cpu);
	if (!mem->stat) {