diff --git a/src/qemu/qemu_command.c b/src/qemu/qemu_command.c index fbf8f0fa53..489b15a283 100644 --- a/src/qemu/qemu_command.c +++ b/src/qemu/qemu_command.c @@ -5138,9 +5138,7 @@ qemuBuildHostdevMediatedDevStr(const virDomainDef *def, g_autofree char *mdevPath = NULL; const char *dev_str = NULL; - if (!(mdevPath = virMediatedDeviceGetSysfsPath(mdevsrc->uuidstr))) - return NULL; - + mdevPath = virMediatedDeviceGetSysfsPath(mdevsrc->uuidstr); dev_str = qemuBuildHostdevMdevModelTypeString(mdevsrc); if (!dev_str) diff --git a/src/util/virmdev.c b/src/util/virmdev.c index 7f4a499536..5f112c775f 100644 --- a/src/util/virmdev.c +++ b/src/util/virmdev.c @@ -140,9 +140,7 @@ virMediatedDeviceNew(const char *uuidstr, virMediatedDeviceModelType model) g_autoptr(virMediatedDevice) dev = NULL; g_autofree char *sysfspath = NULL; - if (!(sysfspath = virMediatedDeviceGetSysfsPath(uuidstr))) - return NULL; - + sysfspath = virMediatedDeviceGetSysfsPath(uuidstr); if (!virFileExists(sysfspath)) { virReportError(VIR_ERR_DEVICE_MISSING, _("mediated device '%s' not found"), uuidstr); @@ -208,9 +206,6 @@ virMediatedDeviceGetIOMMUGroupDev(const char *uuidstr) g_autofree char *iommu_path = NULL; g_autofree char *dev_path = virMediatedDeviceGetSysfsPath(uuidstr); - if (!dev_path) - return NULL; - iommu_path = g_strdup_printf("%s/iommu_group", dev_path); if (!virFileExists(iommu_path)) {