[libvirt] [PATCH 10/24] hostdev: Remove explicit NULL checks

Andrea Bolognani abologna at redhat.com
Mon Mar 7 17:24:26 UTC 2016


NULL checks are performed implicitly in the rest of the module,
including other allocations in the very same function.
---
 src/util/virhostdev.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/util/virhostdev.c b/src/util/virhostdev.c
index 48a44bc..098207e 100644
--- a/src/util/virhostdev.c
+++ b/src/util/virhostdev.c
@@ -142,16 +142,16 @@ virHostdevManagerNew(void)
     if (!(hostdevMgr = virObjectNew(virHostdevManagerClass)))
         return NULL;
 
-    if ((hostdevMgr->activePCIHostdevs = virPCIDeviceListNew()) == NULL)
+    if (!(hostdevMgr->activePCIHostdevs = virPCIDeviceListNew()))
         goto error;
 
-    if ((hostdevMgr->activeUSBHostdevs = virUSBDeviceListNew()) == NULL)
+    if (!(hostdevMgr->activeUSBHostdevs = virUSBDeviceListNew()))
         goto error;
 
-    if ((hostdevMgr->inactivePCIHostdevs = virPCIDeviceListNew()) == NULL)
+    if (!(hostdevMgr->inactivePCIHostdevs = virPCIDeviceListNew()))
         goto error;
 
-    if ((hostdevMgr->activeSCSIHostdevs = virSCSIDeviceListNew()) == NULL)
+    if (!(hostdevMgr->activeSCSIHostdevs = virSCSIDeviceListNew()))
         goto error;
 
     if (privileged) {
-- 
2.5.0




More information about the libvir-list mailing list