]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
virChrdevAlloc: `virHashNew` cannot return NULL
authorTim Wiederhake <twiederh@redhat.com>
Mon, 5 Jul 2021 14:51:35 +0000 (16:51 +0200)
committerTim Wiederhake <twiederh@redhat.com>
Fri, 23 Jul 2021 09:30:49 +0000 (11:30 +0200)
Signed-off-by: Tim Wiederhake <twiederh@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
src/conf/virchrdev.c

index 91f2b5a23394734af7e3828bd2c5ff3b97b92ad7..5d6de684274e8bff3237f9d358f2a4caf1729dd2 100644 (file)
@@ -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;
 }
 
 /**