[libvirt PATCH] util: virNetDevTapCreate: initialize fd to -1

Ján Tomko posted 1 patch 2 weeks ago
Test syntax-check failed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/libvirt tags/patchew/2b6cd855042984b87beb7e3c30b67b0f586d89bb.1600081393.git.jtomko@redhat.com
src/util/virnetdevtap.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

[libvirt PATCH] util: virNetDevTapCreate: initialize fd to -1

Posted by Ján Tomko 2 weeks ago
Signed-off-by: Ján Tomko <jtomko@redhat.com>
Fixes: 95089f481e003d971fe0a082018216c58c1b80e5
---
Pushed as trivial.

 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 ab5959c646..cbce5c71b7 100644
--- a/src/util/virnetdevtap.c
+++ b/src/util/virnetdevtap.c
@@ -322,7 +322,7 @@ int virNetDevTapCreate(char **ifname,
     size_t i = 0;
     struct ifreq ifr;
     int ret = -1;
-    int fd = 0;
+    int fd = -1;
 
     virMutexLock(&virNetDevTapCreateMutex);
 
-- 
2.26.2

Re: [libvirt PATCH] util: virNetDevTapCreate: initialize fd to -1

Posted by Laine Stump 1 week ago
derp! :-O

<raises hand in shame>

On 9/14/20 7:03 AM, Ján Tomko wrote:
> Signed-off-by: Ján Tomko <jtomko@redhat.com>
> Fixes: 95089f481e003d971fe0a082018216c58c1b80e5
> ---
> Pushed as trivial.
>
>   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 ab5959c646..cbce5c71b7 100644
> --- a/src/util/virnetdevtap.c
> +++ b/src/util/virnetdevtap.c
> @@ -322,7 +322,7 @@ int virNetDevTapCreate(char **ifname,
>       size_t i = 0;
>       struct ifreq ifr;
>       int ret = -1;
> -    int fd = 0;
> +    int fd = -1;
>   
>       virMutexLock(&virNetDevTapCreateMutex);
>