From 62464003298b135bfeb5a89ebda51e6ebd13cfac Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Tue, 9 Jul 2019 16:51:43 +0200 Subject: [PATCH] virnetworkobj: Drop needless cleanup label in virNetworkObjAddPort The cleanup label in virNetworkObjAddPort() function serves no purpose. Drop it and thus simplify the function a bit. Signed-off-by: Michal Privoznik Reviewed-by: Erik Skultety --- src/conf/virnetworkobj.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/conf/virnetworkobj.c b/src/conf/virnetworkobj.c index 45726e4016..37580b4e76 100644 --- a/src/conf/virnetworkobj.c +++ b/src/conf/virnetworkobj.c @@ -1625,7 +1625,6 @@ virNetworkObjAddPort(virNetworkObjPtr net, virNetworkPortDefPtr portdef, const char *stateDir) { - int ret = -1; char uuidstr[VIR_UUID_STRING_BUFLEN]; VIR_AUTOFREE(char *) dir = NULL; @@ -1635,24 +1634,21 @@ virNetworkObjAddPort(virNetworkObjPtr net, virReportError(VIR_ERR_NETWORK_PORT_EXIST, _("Network port with UUID %s already exists"), uuidstr); - goto cleanup; + return -1; } if (!(dir = virNetworkObjGetPortStatusDir(net, stateDir))) - goto cleanup; + return -1; if (virHashAddEntry(net->ports, uuidstr, portdef) < 0) - goto cleanup; + return -1; if (virNetworkPortDefSaveStatus(portdef, dir) < 0) { virHashRemoveEntry(net->ports, uuidstr); - goto cleanup; + return -1; } - ret = 0; - - cleanup: - return ret; + return 0; } -- GitLab