From: Radoslaw Biernacki Date: Tue, 22 Jan 2019 19:26:15 +0000 (-0700) Subject: util: Fixing invalid error checking from virPCIGetNetname() X-Git-Tag: v5.1.0-rc1~395 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=04983c3c6a821f67994b1c65d4d6175f3ac49d69;p=thirdparty%2Flibvirt.git util: Fixing invalid error checking from virPCIGetNetname() The @linkdev is In/Out function parameter as second order reference pointer so requires first order dereference for checking NULL which can be the result of virPCIGetNetName(). Fixes: d6ee56d7237 (util: change virPCIGetNetName() to not return error if device has no net name) Signed-off-by: Radoslaw Biernacki Signed-off-by: dann frazier --- diff --git a/src/util/virhostdev.c b/src/util/virhostdev.c index 41d4e8d936..880ca083d4 100644 --- a/src/util/virhostdev.c +++ b/src/util/virhostdev.c @@ -314,7 +314,7 @@ virHostdevNetDevice(virDomainHostdevDefPtr hostdev, if (virPCIGetNetName(sysfs_path, 0, NULL, linkdev) < 0) return -1; - if (!linkdev) { + if (!(*linkdev)) { virReportError(VIR_ERR_INTERNAL_ERROR, _("The device at %s has no network device name"), sysfs_path);