render / rpms / libvirt

Forked from rpms/libvirt 9 months ago
Clone
Blob Blame History Raw
From 3b2892c175918021f78a7dfc8dac39f4c451a15f Mon Sep 17 00:00:00 2001
Message-Id: <3b2892c175918021f78a7dfc8dac39f4c451a15f@dist-git>
From: =?UTF-8?q?J=C3=A1n=20Tomko?= <jtomko@redhat.com>
Date: Sat, 12 Dec 2020 22:04:53 -0500
Subject: [PATCH] util: virNetDevTapCreate: initialize fd to -1
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Ján Tomko <jtomko@redhat.com>
Fixes: 95089f481e003d971fe0a082018216c58c1b80e5
(cherry picked from commit 2b6cd855042984b87beb7e3c30b67b0f586d89bb)

https://bugzilla.redhat.com/1874304
Signed-off-by: Laine Stump <laine@redhat.com>
Message-Id: <20201213030453.48851-4-laine@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
---
 src/util/virnetdevtap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/util/virnetdevtap.c b/src/util/virnetdevtap.c
index fd4b70df30..d333163ff9 100644
--- a/src/util/virnetdevtap.c
+++ b/src/util/virnetdevtap.c
@@ -318,7 +318,7 @@ int virNetDevTapCreate(char **ifname,
     size_t i = 0;
     struct ifreq ifr;
     int ret = -1;
-    int fd = 0;
+    int fd = -1;
 
     virMutexLock(&virNetDevTapCreateMutex);
 
-- 
2.29.2