[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[libvirt] [PATCH v3 4/4] util: Fixing invalid error checking from virPCIGetNetname()



From: Radoslaw Biernacki <radoslaw biernacki linaro org>

linkdev is In/Out function parameter as second order reference pointer
so requires first order dereference for checking NULLs which can be a
result from 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>
Reviewed-by: Michal Privoznik <mprivozn redhat com>
Signed-off-by: dann frazier <dann frazier canonical com>
---
 src/util/virhostdev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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);
-- 
2.20.1


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]