From: Michal Privoznik Date: Tue, 6 Aug 2019 11:44:17 +0000 (+0200) Subject: qemuDomainGetResctrlMonData: Dereference resctrl monitor iff not NULL X-Git-Tag: v5.7.0-rc1~372 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9fc616cc101cdf8cd4a4679d2aa6db5ff5455c14;p=thirdparty%2Flibvirt.git qemuDomainGetResctrlMonData: Dereference resctrl monitor iff not NULL 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 Reviewed-by: Ján Tomko --- 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"));