From: Nishanth Aravamudan <nacc@linux.vnet.ibm.com>
Date: Thu, 9 Oct 2014 23:41:28 +0000 (-0700)
Subject: powerpc/numa: check error return from proc_create
X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2d15b9b479512f05680541acffd9acbbc831a47c;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git

powerpc/numa: check error return from proc_create

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

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

diff --git a/arch/powerpc/mm/numa.c b/arch/powerpc/mm/numa.c
index 649666d5d1c2..51d707d85b2d 100644
--- a/arch/powerpc/mm/numa.c
+++ b/arch/powerpc/mm/numa.c
@@ -1801,7 +1801,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;
 }