[PATCH] mm/memcontrol.c: add memory allocation result check

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Wenwei Tao <ww.tao0320@xxxxxxxxx>

The mem_cgroup_tree_per_node allocation might fail,
check that before continue the memcg init. Since it
is in the init phase, trigger the panic if that failure
happens.

Signed-off-by: Wenwei Tao <ww.tao0320@xxxxxxxxx>
---
 mm/memcontrol.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 925b431..6385c62 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -5712,6 +5712,7 @@ static int __init mem_cgroup_init(void)
 
 		rtpn = kzalloc_node(sizeof(*rtpn), GFP_KERNEL,
 				    node_online(node) ? node : NUMA_NO_NODE);
+		BUG_ON(!rtpn);
 
 		for (zone = 0; zone < MAX_NR_ZONES; zone++) {
 			struct mem_cgroup_tree_per_zone *rtpz;
-- 
1.8.3.1


--
To unsubscribe from this list: send the line "unsubscribe cgroups" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]     [Monitors]

  Powered by Linux