Fixes: 224d269f19f0a6c496dd2218f934a54742d51708
Signed-off-by: Ján Tomko <jtomko(a)redhat.com>
---
src/qemu/qemu_domain.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/src/qemu/qemu_domain.c b/src/qemu/qemu_domain.c
index 9c517597bb..ffac73dd42 100644
--- a/src/qemu/qemu_domain.c
+++ b/src/qemu/qemu_domain.c
@@ -12835,8 +12835,7 @@ qemuDomainGetHostdevPath(virDomainDefPtr def,
if (!usb)
goto cleanup;
- if (VIR_STRDUP(tmpPath, virUSBDeviceGetPath(usb)) < 0)
- goto cleanup;
+ tmpPath = g_strdup(virUSBDeviceGetPath(usb));
perm = VIR_CGROUP_DEVICE_RW;
break;
@@ -12857,8 +12856,7 @@ qemuDomainGetHostdevPath(virDomainDefPtr def,
if (!scsi)
goto cleanup;
- if (VIR_STRDUP(tmpPath, virSCSIDeviceGetPath(scsi)) < 0)
- goto cleanup;
+ tmpPath = g_strdup(virSCSIDeviceGetPath(scsi));
perm = virSCSIDeviceGetReadonly(scsi) ?
VIR_CGROUP_DEVICE_READ : VIR_CGROUP_DEVICE_RW;
}
@@ -12870,8 +12868,7 @@ qemuDomainGetHostdevPath(virDomainDefPtr def,
if (!(host = virSCSIVHostDeviceNew(hostsrc->wwpn)))
goto cleanup;
- if (VIR_STRDUP(tmpPath, virSCSIVHostDeviceGetPath(host)) < 0)
- goto cleanup;
+ tmpPath = g_strdup(virSCSIVHostDeviceGetPath(host));
perm = VIR_CGROUP_DEVICE_RW;
}
break;
--
2.21.0