util: eliminate superfluous saveVlan check in virNetDevSetNetConfig()

Commit 81fb440b further qualified an if statement by adding the
boolean saveVlan to the condition. Coverity pointed out that this
change in the logic eliminated the need to check saveVlan in an
argument to virAsprintf().
This commit is contained in:
Laine Stump 2017-08-13 11:32:31 -04:00
parent 83074cc917
commit f5bc8b5436

View File

@ -1936,10 +1936,8 @@ virNetDevSaveNetConfig(const char *linkdev, int vf,
goto cleanup;
/* get admin MAC and vlan tag */
if (virNetDevGetVfConfig(pfDevName, vf, &oldMAC,
saveVlan ? &oldVlanTag : NULL) < 0) {
if (virNetDevGetVfConfig(pfDevName, vf, &oldMAC, &oldVlanTag) < 0)
goto cleanup;
}
if (virJSONValueObjectAppendString(configJSON,
VIR_NETDEV_KEYNAME_ADMIN_MAC,