From: Laine Stump Date: Sun, 13 Aug 2017 15:32:31 +0000 (-0400) Subject: util: eliminate superfluous saveVlan check in virNetDevSetNetConfig() X-Git-Tag: v3.7.0-rc1~163 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f5bc8b54363233ae42a50094faef4f703e46cd28;p=thirdparty%2Flibvirt.git 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(). --- diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c index ae7da53425..51a6e42c5c 100644 --- a/src/util/virnetdev.c +++ b/src/util/virnetdev.c @@ -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,