提交 b7890a8c 编写于 作者: J John Ferlan

qemu: Remove possible NULL deref in debug output

Check for !dev->info.alias was done after a VIR_DEBUG() statement
that already tried to print - just flip sequence
上级 99186c41
......@@ -1887,14 +1887,14 @@ int qemuDomainChangeNetLinkState(virQEMUDriverPtr driver,
int ret = -1;
qemuDomainObjPrivatePtr priv = vm->privateData;
VIR_DEBUG("dev: %s, state: %d", dev->info.alias, linkstate);
if (!dev->info.alias) {
virReportError(VIR_ERR_OPERATION_FAILED, "%s",
_("can't change link state: device alias not found"));
return -1;
}
VIR_DEBUG("dev: %s, state: %d", dev->info.alias, linkstate);
qemuDomainObjEnterMonitor(driver, vm);
ret = qemuMonitorSetLink(priv->mon, dev->info.alias, linkstate);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册