]> xenbits.xensource.com Git - libvirt.git/commitdiff
util: Fixing invalid error checking from virPCIGetNetname()
authorRadoslaw Biernacki <radoslaw.biernacki@linaro.org>
Tue, 22 Jan 2019 19:26:15 +0000 (12:26 -0700)
committerMichal Privoznik <mprivozn@redhat.com>
Wed, 23 Jan 2019 09:21:35 +0000 (10:21 +0100)
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 <radoslaw.biernacki@linaro.org>
Signed-off-by: dann frazier <dann.frazier@canonical.com>
src/util/virhostdev.c

index 41d4e8d9368bfa0a65a42ce7db90b426eb14f89e..880ca083d4b74d39d4069d9a087febdde08b0cce 100644 (file)
@@ -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);