mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-03-20 07:59:00 +00:00
util: fix improper assignment of return value in virHostdevReadNetConfig()
Commit 9a94af6d restructured virHostdevReadNetConfig() so that it would manually set ret = 0 after successfully reading the device's config, but Coverity pointed out that "ret = 0" was erroneously placed outside of an "else" clause, meaning that the the value of ret set in the "if" clause was unnecessarily and incorrectly overwritten. This patch moves ret = 0 into the else clause, which should silence Coverity.
This commit is contained in:
parent
cd3c4eece2
commit
83074cc917
@ -641,9 +641,9 @@ virHostdevRestoreNetConfig(virDomainHostdevDefPtr hostdev,
|
||||
|
||||
ignore_value(virNetDevSetNetConfig(linkdev, vf,
|
||||
adminMAC, vlan, MAC, true));
|
||||
ret = 0;
|
||||
}
|
||||
|
||||
ret = 0;
|
||||
cleanup:
|
||||
VIR_FREE(linkdev);
|
||||
VIR_FREE(MAC);
|
||||
|
Loading…
x
Reference in New Issue
Block a user