render / rpms / libvirt

Forked from rpms/libvirt 10 months ago
Clone
9119d9
From 062d83e7ebeb22461e626b0bc267f8b36871cbb3 Mon Sep 17 00:00:00 2001
9119d9
Message-Id: <062d83e7ebeb22461e626b0bc267f8b36871cbb3@dist-git>
9119d9
From: John Ferlan <jferlan@redhat.com>
9119d9
Date: Mon, 3 Nov 2014 10:00:25 -0500
9119d9
Subject: [PATCH] virnetdev: Resolve Coverity FORWARD_NULL
9119d9
9119d9
https://bugzilla.redhat.com/show_bug.cgi?id=848199
9119d9
9119d9
The complaint is that if cleanup is called when virFileReadAll fails,
9119d9
then mcast->entries is NULL and could be dereferenced in the clear
9119d9
function. After following the code some - I saw that the caller to
9119d9
the function (virNetDevGetMulticastTable) will also call
9119d9
virNetDevMcastListClear if this function returns -1, so this
9119d9
isn't necessary, so I removed the call.
9119d9
9119d9
(cherry picked from commit f099726c4684d76cde714bfc5edbd9bbec35da49)
9119d9
9119d9
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
9119d9
---
9119d9
 src/util/virnetdev.c | 3 ---
9119d9
 1 file changed, 3 deletions(-)
9119d9
9119d9
diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c
9119d9
index 147ec5b..e3f6bd0 100644
9119d9
--- a/src/util/virnetdev.c
9119d9
+++ b/src/util/virnetdev.c
9119d9
@@ -2193,9 +2193,6 @@ static int virNetDevGetMcastList(const char *ifname,
9119d9
 
9119d9
     ret = 0;
9119d9
  cleanup:
9119d9
-    if (ret < 0)
9119d9
-        virNetDevMcastListClear(mcast);
9119d9
-
9119d9
     VIR_FREE(entry);
9119d9
 
9119d9
     return ret;
9119d9
-- 
9119d9
2.1.3
9119d9