projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9d34706
)
memcontrol: fix potential null deref
author
Dan Carpenter
<
[email protected]
>
Tue, 23 Mar 2010 20:35:12 +0000
(13:35 -0700)
committer
Linus Torvalds
<
[email protected]
>
Wed, 24 Mar 2010 23:31:19 +0000
(16:31 -0700)
There was a potential null deref introduced in
c62b1a3b31b5
("memcg: use
generic percpu instead of private implementation").
Signed-off-by: Dan Carpenter <
[email protected]
>
Acked-by: KAMEZAWA Hiroyuki <
[email protected]
>
Signed-off-by: Andrew Morton <
[email protected]
>
Signed-off-by: Linus Torvalds <
[email protected]
>
mm/memcontrol.c
patch
|
blob
|
history
diff --git
a/mm/memcontrol.c
b/mm/memcontrol.c
index 00dda352144c962468443241bfe564b06b933b2f..9ed760dc74481a7436e3ab7b084ff8abd233ee01 100644
(file)
--- a/
mm/memcontrol.c
+++ b/
mm/memcontrol.c
@@
-3691,8
+3691,10
@@
static struct mem_cgroup *mem_cgroup_alloc(void)
else
mem = vmalloc(size);
- if (mem)
- memset(mem, 0, size);
+ if (!mem)
+ return NULL;
+
+ memset(mem, 0, size);
mem->stat = alloc_percpu(struct mem_cgroup_stat_cpu);
if (!mem->stat) {
if (size < PAGE_SIZE)