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

Nishanth Aravamudan nacc at linux.vnet.ibm.com
Fri Oct 10 10:41:28 AEDT 2014


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

Suggested-by: Michael Ellerman <mpe at ellerman.id.au>
Signed-off-by: Nishanth Aravamudan <nacc at linux.vnet.ibm.com>

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;
 }



More information about the Linuxppc-dev mailing list