[libvirt] [PATCH v2 1/3] conf: Need to unlock pools on object allocation failure

John Ferlan posted 3 patches 7 years, 4 months ago
[libvirt] [PATCH v2 1/3] conf: Need to unlock pools on object allocation failure
Posted by John Ferlan 7 years, 4 months ago
The RW pool could be left unlocked if allocation fails.

Signed-off-by: John Ferlan <jferlan@redhat.com>
---
 src/conf/virstorageobj.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/conf/virstorageobj.c b/src/conf/virstorageobj.c
index 49fe24b28..19903b6c5 100644
--- a/src/conf/virstorageobj.c
+++ b/src/conf/virstorageobj.c
@@ -748,7 +748,7 @@ virStoragePoolObjAssignDef(virStoragePoolObjListPtr pools,
     }
 
     if (!(obj = virStoragePoolObjNew()))
-        return NULL;
+        goto error;
 
     virUUIDFormat(def->uuid, uuidstr);
     if (virHashAddEntry(pools->objs, uuidstr, obj) < 0)
-- 
2.13.6

--
libvir-list mailing list
libvir-list@redhat.com
https://www.redhat.com/mailman/listinfo/libvir-list
Re: [libvirt] [PATCH v2 1/3] conf: Need to unlock pools on object allocation failure
Posted by Erik Skultety 7 years, 4 months ago
On Mon, Dec 18, 2017 at 07:56:52AM -0500, John Ferlan wrote:
> The RW pool could be left unlocked if allocation fails.

s/unlocked/locked

Erik

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