From f5bc8b54363233ae42a50094faef4f703e46cd28 Mon Sep 17 00:00:00 2001 From: Laine Stump Date: Sun, 13 Aug 2017 11:32:31 -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(). --- 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 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, -- GitLab