From b18e5e3ddd2cdd177f598cf44f2b21fe47db51a2 Mon Sep 17 00:00:00 2001
Message-Id: <b18e5e3ddd2cdd177f598cf44f2b21fe47db51a2@dist-git>
From: Laine Stump <laine@laine.org>
Date: Mon, 14 Aug 2017 21:28:24 -0400
Subject: [PATCH] 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().
Resolves: https://bugzilla.redhat.com/1460082
(cherry picked from commit f5bc8b54363233ae42a50094faef4f703e46cd28)
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
---
src/util/virnetdev.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c
index 2e569da2c8..73be9a312d 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,
--
2.14.1