提交 2ab1a553 编写于 作者: R Rikard Falkeborn 提交者: Ján Tomko

vz: Fix return value in error path

If PrlVmDev_GetType(), PrlVmDev_GetIndex() or PrlVmCfg_GetBootDevCount()
fails, return false to indicate error. Returning -1 would be interpreted
as true when used in an if-statement.

Fixes: 8c9252aaSigned-off-by: NRikard Falkeborn <rikard.falkeborn@gmail.com>
Signed-off-by: NJán Tomko <jtomko@redhat.com>
Reviewed-by: NJán Tomko <jtomko@redhat.com>
上级 d9254cb0
......@@ -1609,13 +1609,13 @@ prlsdkInBootList(PRL_HANDLE sdkdom,
size_t i;
pret = PrlVmDev_GetType(sdktargetdev, &targetType);
prlsdkCheckRetExit(pret, -1);
prlsdkCheckRetExit(pret, false);
pret = PrlVmDev_GetIndex(sdktargetdev, &targetIndex);
prlsdkCheckRetExit(pret, -1);
prlsdkCheckRetExit(pret, false);
pret = PrlVmCfg_GetBootDevCount(sdkdom, &bootNum);
prlsdkCheckRetExit(pret, -1);
prlsdkCheckRetExit(pret, false);
for (i = 0; i < bootNum; ++i) {
pret = PrlVmCfg_GetBootDev(sdkdom, i, &bootDev);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册