]> xenbits.xensource.com Git - libvirt.git/commitdiff
hostdev: Remove explicit NULL checks
authorAndrea Bolognani <abologna@redhat.com>
Thu, 25 Feb 2016 13:50:54 +0000 (14:50 +0100)
committerAndrea Bolognani <abologna@redhat.com>
Tue, 8 Mar 2016 09:44:01 +0000 (10:44 +0100)
NULL checks are performed implicitly in the rest of the module,
including other allocations in the very same function.

src/util/virhostdev.c

index 48a44bc2a23a3ec0c12c957796b0099c6e58a1e9..098207e798f1a1ba0326145f5cde0ff9315f244a 100644 (file)
@@ -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) {