[PATCH] nodeinfo: Check for errors when reading core_id

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 src/nodeinfo.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/nodeinfo.c b/src/nodeinfo.c
index fb932c8..ba633a1 100644
--- a/src/nodeinfo.c
+++ b/src/nodeinfo.c
@@ -512,7 +512,9 @@ virNodeParseNode(const char *node,
             /* logical cpu is equivalent to a core on s390 */
             core = cpu;
         } else {
-            core = virNodeGetCpuValue(node, cpu, "topology/core_id", 0);
+            if ((core = virNodeGetCpuValue(node, cpu,
+                                           "topology/core_id", 0)) < 0)
+                goto cleanup;
         }
         if (core > ID_MAX) {
             virReportError(VIR_ERR_INTERNAL_ERROR,
-- 
2.4.3

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list



[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]