Blame SOURCES/numactl-2.0.9-hw-detect-segfault.patch

02ddd2
From: Elena Ufimtseva <ufimtseva@gmail.com>
02ddd2
To: linux-numa@vger.kernel.org
02ddd2
Cc: cpw@sgi.com, Elena Ufimtseva <ufimtseva@gmail.com>
02ddd2
Subject: [PATCH] numactl: checks for numa when showing hardware
02ddd2
Date: Sat, 23 Nov 2013 03:10:41 -0500
02ddd2
02ddd2
Checks if NUMA is available before printing hardware,
02ddd2
otherwise segfault occurs.
02ddd2
02ddd2
Signed-off-by: Elena Ufimtseva <ufimtseva@gmail.com>
02ddd2
---
02ddd2
 numactl.c |    5 +++++
02ddd2
 1 files changed, 5 insertions(+), 0 deletions(-)
02ddd2
02ddd2
diff --git a/numactl.c b/numactl.c
02ddd2
index 97955a4..f30b53c 100755
02ddd2
--- a/numactl.c
02ddd2
+++ b/numactl.c
02ddd2
@@ -242,6 +242,11 @@ void hardware(void)
02ddd2
 	int prevnode=-1;
02ddd2
 	int skip=0;
02ddd2
 	int maxnode = numa_max_node();
02ddd2
+	
02ddd2
+	if (numa_available() < 0) {
02ddd2
+                printf("No NUMA available on this system\n");
02ddd2
+                exit(1);
02ddd2
+        }
02ddd2
 
02ddd2
 	for (i=0; i<=maxnode; i++)
02ddd2
 		if (numa_bitmask_isbitset(numa_nodes_ptr, i))