summaryrefslogtreecommitdiff
path: root/src/interface
diff options
context:
space:
mode:
authorJán Tomko <jtomko@redhat.com>2020-11-20 14:05:54 +0100
committerJán Tomko <jtomko@redhat.com>2020-12-01 17:22:09 +0100
commitfd5df67dce231b447e02b8ba6648d158b84cc584 (patch)
tree21c2e09873a78fa96dbd479941ab18c228c7b9a0 /src/interface
parent6e91453bb6a6f1925c70f5323f8f0ea91ffc022d (diff)
downloadlibvirt-fd5df67dce231b447e02b8ba6648d158b84cc584.tar.gz
udevConnectListAllInterfaces: initialize ret
Currently, ret is only used in the 'cleanup' section and initialized right before the jump. Switch to the customary initialization to -1 and only leave in the 'ret = 0' statement on an empty list. Signed-off-by: Ján Tomko <jtomko@redhat.com> Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
Diffstat (limited to 'src/interface')
-rw-r--r--src/interface/interface_backend_udev.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/interface/interface_backend_udev.c b/src/interface/interface_backend_udev.c
index ce007fd29e..31246dde74 100644
--- a/src/interface/interface_backend_udev.c
+++ b/src/interface/interface_backend_udev.c
@@ -303,7 +303,7 @@ udevConnectListAllInterfaces(virConnectPtr conn,
int tmp_count;
int count = 0;
int status = 0;
- int ret;
+ int ret = -1;
virCheckFlags(VIR_CONNECT_LIST_INTERFACES_FILTERS_ACTIVE, -1);
@@ -320,7 +320,6 @@ udevConnectListAllInterfaces(virConnectPtr conn,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("failed to get list of %s interfaces on host"),
virUdevStatusString(status));
- ret = -1;
goto cleanup;
}