mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-02-22 19:32:19 +00:00
qemu: Resolve Coverity FORWARD_NULL
Coverity points out that qemuMonitorGetAllBlockStatsInfo could return a -1 and thus not fill in 'stats' (leaving it NULL). Then the call to qemuMonitorBlockStatsUpdateCapacity will dereference it.
This commit is contained in:
parent
3e4ce35926
commit
b8e60f00d8
@ -19633,8 +19633,9 @@ qemuDomainGetStatsBlock(virQEMUDriverPtr driver,
|
||||
qemuDomainObjEnterMonitor(driver, dom);
|
||||
rc = qemuMonitorGetAllBlockStatsInfo(priv->mon, &stats,
|
||||
visitBacking);
|
||||
ignore_value(qemuMonitorBlockStatsUpdateCapacity(priv->mon, stats,
|
||||
visitBacking));
|
||||
if (rc >= 0)
|
||||
ignore_value(qemuMonitorBlockStatsUpdateCapacity(priv->mon, stats,
|
||||
visitBacking));
|
||||
if (qemuDomainObjExitMonitor(driver, dom) < 0)
|
||||
goto cleanup;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user