[libvirt] [PATCH 1/9] virDomainObjListAddLocked: Drop useless @cleanup label

Michal Privoznik posted 9 patches 5 years, 6 months ago
There is a newer version of this series
[libvirt] [PATCH 1/9] virDomainObjListAddLocked: Drop useless @cleanup label
Posted by Michal Privoznik 5 years, 6 months ago
It's a premature optimization. It's perfectly acceptable for
'error' label to deal with @vm == NULL case.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
---
 src/conf/virdomainobjlist.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/conf/virdomainobjlist.c b/src/conf/virdomainobjlist.c
index f5a7ecc4a4..d58d25f847 100644
--- a/src/conf/virdomainobjlist.c
+++ b/src/conf/virdomainobjlist.c
@@ -332,7 +332,7 @@ virDomainObjListAddLocked(virDomainObjListPtr doms,
         }
 
         if (!(vm = virDomainObjNew(xmlopt)))
-            goto cleanup;
+            goto error;
         vm->def = def;
 
         if (virDomainObjListAddObjLocked(doms, vm) < 0) {
@@ -340,7 +340,7 @@ virDomainObjListAddLocked(virDomainObjListPtr doms,
             goto error;
         }
     }
- cleanup:
+
     return vm;
 
  error:
-- 
2.21.0

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH 1/9] virDomainObjListAddLocked: Drop useless @cleanup label
Posted by Nikolay Shirokovskiy 5 years, 5 months ago

On 30.05.2019 12:33, Michal Privoznik wrote:
> It's a premature optimization. It's perfectly acceptable for
> 'error' label to deal with @vm == NULL case.
> 
> Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
> ---
>  src/conf/virdomainobjlist.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 

Reviewed-by: Nikolay Shirokovskiy <nshirokovskiy@virtuozzo.com>

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list