[libvirt PATCH 12/38] qemuBlockNodeNamesDetect: `virHashNew` cannot return NULL

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


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

diff --git a/src/qemu/qemu_block.c b/src/qemu/qemu_block.c
index 6627d044cd..2815eb54fa 100644
--- a/src/qemu/qemu_block.c
+++ b/src/qemu/qemu_block.c
@@ -365,10 +365,7 @@ qemuBlockNodeNamesDetect(virQEMUDriver *driver,
 GHashTable *
 qemuBlockGetNodeData(virJSONValue *data)
 {
-    g_autoptr(GHashTable) nodedata = NULL;
-
-    if (!(nodedata = virHashNew(virJSONValueHashFree)))
-        return NULL;
+    g_autoptr(GHashTable) nodedata = virHashNew(virJSONValueHashFree);
 
     if (virJSONValueArrayForeachSteal(data,
                                       qemuBlockNamedNodesArrayToHash, nodedata) < 0)
-- 
2.31.1




More information about the libvir-list mailing list