[libvirt PATCH 16/38] virChrdevAlloc: `virHashNew` cannot return NULL

Tim Wiederhake twiederh at redhat.com
Thu Jul 22 07:50:08 UTC 2021


Signed-off-by: Tim Wiederhake <twiederh at redhat.com>
---
 src/conf/virchrdev.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/src/conf/virchrdev.c b/src/conf/virchrdev.c
index 91f2b5a233..5d6de68427 100644
--- a/src/conf/virchrdev.c
+++ b/src/conf/virchrdev.c
@@ -265,13 +265,9 @@ virChrdevs *virChrdevAlloc(void)
 
     /* there will hardly be any devices most of the time, the hash
      * does not have to be huge */
-    if (!(devs->hash = virHashNew(virChrdevHashEntryFree)))
-        goto error;
+    devs->hash = virHashNew(virChrdevHashEntryFree);
 
     return devs;
- error:
-    virChrdevFree(devs);
-    return NULL;
 }
 
 /**
-- 
2.31.1




More information about the libvir-list mailing list