]> xenbits.xensource.com Git - libvirt.git/commitdiff
util: eliminate superfluous saveVlan check in virNetDevSetNetConfig()
authorLaine Stump <laine@laine.org>
Sun, 13 Aug 2017 15:32:31 +0000 (11:32 -0400)
committerLaine Stump <laine@laine.org>
Mon, 14 Aug 2017 03:07:13 +0000 (23:07 -0400)
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().

src/util/virnetdev.c

index ae7da53425b5aa326c29c62f666b53ecbbb0c316..51a6e42c5ca8b07eca1ec3886aaaec9b644fa8cf 100644 (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,