From: Ján Tomko Date: Thu, 18 Feb 2021 13:10:10 +0000 (+0100) Subject: security: dac: remove leftover virPCIDeviceFree X-Git-Tag: v7.1.0-rc1~54 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f4943d3c1874d47d2995e4ab2685f0e252e9ce9c;p=thirdparty%2Flibvirt.git security: dac: remove leftover virPCIDeviceFree The switch to g_auto left this one call behind. Reported by Coverity. Fixes: 4ab0d1844a1e60def576086edc8b2c3775e7c10d Signed-off-by: Ján Tomko Reviewed-by: Erik Skultety --- diff --git a/src/security/security_dac.c b/src/security/security_dac.c index 00eeae0d27..11f6c5c3da 100644 --- a/src/security/security_dac.c +++ b/src/security/security_dac.c @@ -1430,10 +1430,9 @@ virSecurityDACRestoreHostdevLabel(virSecurityManagerPtr mgr, if (pcisrc->backend == VIR_DOMAIN_HOSTDEV_PCI_BACKEND_VFIO) { g_autofree char *vfioGroupDev = virPCIDeviceGetIOMMUGroupDev(pci); - if (!vfioGroupDev) { - virPCIDeviceFree(pci); + if (!vfioGroupDev) return -1; - } + ret = virSecurityDACRestoreFileLabelInternal(mgr, NULL, vfioGroupDev, false); } else {