7a3408
From 79b6cde136f9f067bfc2ef2477525218f2c4ca19 Mon Sep 17 00:00:00 2001
7a3408
Message-Id: <79b6cde136f9f067bfc2ef2477525218f2c4ca19@dist-git>
7a3408
From: Andrea Bolognani <abologna@redhat.com>
7a3408
Date: Wed, 5 Aug 2015 18:18:32 +0200
7a3408
Subject: [PATCH] nodeinfo: Check for errors when reading core_id
7a3408
7a3408
(cherry picked from commit f86c45ca0c10c84c954ed201531ab31129d9c9c3)
7a3408
7a3408
Bug: https://bugzilla.redhat.com/show_bug.cgi?id=1213713
7a3408
7a3408
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
7a3408
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
7a3408
---
7a3408
 src/nodeinfo.c | 4 +++-
7a3408
 1 file changed, 3 insertions(+), 1 deletion(-)
7a3408
7a3408
diff --git a/src/nodeinfo.c b/src/nodeinfo.c
7a3408
index 6c8849d..8b56376 100644
7a3408
--- a/src/nodeinfo.c
7a3408
+++ b/src/nodeinfo.c
7a3408
@@ -511,7 +511,9 @@ virNodeParseNode(const char *node,
7a3408
             /* logical cpu is equivalent to a core on s390 */
7a3408
             core = cpu;
7a3408
         } else {
7a3408
-            core = virNodeGetCpuValue(node, cpu, "topology/core_id", 0);
7a3408
+            if ((core = virNodeGetCpuValue(node, cpu,
7a3408
+                                           "topology/core_id", 0)) < 0)
7a3408
+                goto cleanup;
7a3408
         }
7a3408
         if (core > ID_MAX) {
7a3408
             virReportError(VIR_ERR_INTERNAL_ERROR,
7a3408
-- 
7a3408
2.5.0
7a3408