From: Andrea Bolognani Date: Thu, 25 Feb 2016 13:50:54 +0000 (+0100) Subject: hostdev: Remove explicit NULL checks X-Git-Tag: v1.3.3-rc1~264 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=12a1631440c8db098bf4cba16e3fd4aca09951c4;p=thirdparty%2Flibvirt.git hostdev: Remove explicit NULL checks NULL checks are performed implicitly in the rest of the module, including other allocations in the very same function. --- diff --git a/src/util/virhostdev.c b/src/util/virhostdev.c index 48a44bc2a2..098207e798 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) {