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

[Xen-changelog] [xen master] tools: libxencall/foreignmemory: initialise handle->fd



commit 7db1f6a67da2ba4997ad2079f0c652b3a18fd9d5
Author:     Ian Campbell <ian.campbell@xxxxxxxxxx>
AuthorDate: Wed Feb 3 10:09:42 2016 +0000
Commit:     Ian Campbell <ian.campbell@xxxxxxxxxx>
CommitDate: Wed Feb 3 11:23:43 2016 +0000

    tools: libxencall/foreignmemory: initialise handle->fd
    
    Otherwise the osdep close on the error path touches an uninitialised
    varialble.
    
    CID: 1351231 (foreignmemory) and 1351230 (call)
    
    Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
    Acked-by: Wei Liu <wei.liu2@xxxxxxxxxx>
---
 tools/libs/call/core.c          | 2 ++
 tools/libs/foreignmemory/core.c | 1 +
 2 files changed, 3 insertions(+)

diff --git a/tools/libs/call/core.c b/tools/libs/call/core.c
index bbf88de..5ca0372 100644
--- a/tools/libs/call/core.c
+++ b/tools/libs/call/core.c
@@ -24,6 +24,8 @@ xencall_handle *xencall_open(xentoollog_logger *logger, 
unsigned open_flags)
 
     if (!xcall) return NULL;
 
+    xcall->fd = -1;
+
     xcall->flags = open_flags;
     xcall->buffer_cache_nr = 0;
 
diff --git a/tools/libs/foreignmemory/core.c b/tools/libs/foreignmemory/core.c
index a5110a7..a872b95 100644
--- a/tools/libs/foreignmemory/core.c
+++ b/tools/libs/foreignmemory/core.c
@@ -27,6 +27,7 @@ xenforeignmemory_handle 
*xenforeignmemory_open(xentoollog_logger *logger,
 
     if (!fmem) return NULL;
 
+    fmem->fd = -1;
     fmem->logger = logger;
     fmem->logger_tofree = NULL;
 
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.