linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm:Return proper error code return if call to kzalloc_node falis in the function alloc_mem_cgroup_per_zone_info
@ 2015-06-29 15:46 Nicholas Krause
  2015-06-29 15:52 ` Michal Hocko
  0 siblings, 1 reply; 2+ messages in thread
From: Nicholas Krause @ 2015-06-29 15:46 UTC (permalink / raw)
  To: hannes; +Cc: mhocko, cgroups, linux-mm, linux-kernel

This changes us returning the value of one to -ENOMEM when the call
for allocating memory with the function kzalloc_node fails in order
to better comply with kernel coding pratices of returning this
particular error code when memory allocations that are unrecoverable
occur.

Signed-off-by: Nicholas Krause <xerofoify@gmail.com>
---
 mm/memcontrol.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index acb93c5..4e80811 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -4442,7 +4442,7 @@ static int alloc_mem_cgroup_per_zone_info(struct mem_cgroup *memcg, int node)
 		tmp = -1;
 	pn = kzalloc_node(sizeof(*pn), GFP_KERNEL, tmp);
 	if (!pn)
-		return 1;
+		return -ENOMEM;
 
 	for (zone = 0; zone < MAX_NR_ZONES; zone++) {
 		mz = &pn->zoneinfo[zone];
-- 
2.1.4

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-06-29 15:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-29 15:46 [PATCH] mm:Return proper error code return if call to kzalloc_node falis in the function alloc_mem_cgroup_per_zone_info Nicholas Krause
2015-06-29 15:52 ` Michal Hocko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox