Subject: [PATCH] powerpc/numa: check error return from proc_create

From: Nishanth Aravamudan <[email-masked]>
Date: Thu, 9 Oct 2014 16:41:28 -0700

proc_create can fail, we should check the return value and pass up the
failure.

Suggested-by: Michael Ellerman <[email-masked]>
Signed-off-by: Nishanth Aravamudan <[email-masked]>

diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index d7737a542fd7..e28c21ba862d 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -1808,7 +1808,8 @@ static const struct file_operations topology_ops = {
 static int topology_update_init(void)
 {
 	start_topology_update();
-	proc_create("powerpc/topology_updates", 0644, NULL, &topology_ops);
+	if (!proc_create("powerpc/topology_updates", 0644, NULL, &topology_ops))
+		return -ENOMEM;
 
 	return 0;
 }