[libvirt PATCH 19/38] virDomainDefBootOrderPostParse: `virHashNew` cannot return NULL

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


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

diff --git a/src/conf/domain_conf.c b/src/conf/domain_conf.c
index e05ea9ba88..6937863db7 100644
--- a/src/conf/domain_conf.c
+++ b/src/conf/domain_conf.c
@@ -5924,10 +5924,7 @@ virDomainDefCollectBootOrder(virDomainDef *def G_GNUC_UNUSED,
 static int
 virDomainDefBootOrderPostParse(virDomainDef *def)
 {
-    g_autoptr(GHashTable) bootHash = NULL;
-
-    if (!(bootHash = virHashNew(NULL)))
-        return -1;
+    g_autoptr(GHashTable) bootHash = virHashNew(NULL);
 
     if (virDomainDeviceInfoIterate(def, virDomainDefCollectBootOrder, bootHash) < 0)
         return -1;
-- 
2.31.1




More information about the libvir-list mailing list