[PATCH 2/3] qemuDomainGetResctrlMonData: Dereference resctrl monitor iff not NULL

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

 



If the host doesn't have resctrl then the monitor is going to be
NULL and we must avoid dereferencing it.

Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---
 src/qemu/qemu_driver.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/qemu/qemu_driver.c b/src/qemu/qemu_driver.c
index d5a8beb134..25b6653e38 100644
--- a/src/qemu/qemu_driver.c
+++ b/src/qemu/qemu_driver.c
@@ -20744,7 +20744,8 @@ qemuDomainGetResctrlMonData(virQEMUDriverPtr driver,
     caps = virQEMUDriverGetCapabilities(driver, false);
 
     if (tag == VIR_RESCTRL_MONITOR_TYPE_CACHE) {
-        features = caps->host.cache.monitor->features;
+        if (caps->host.cache.monitor)
+            features = caps->host.cache.monitor->features;
     } else {
         virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",
                        _("Unsupported resctrl monitor type"));
-- 
2.21.0

--
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]

  Powered by Linux