All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tools: libxencall/foreignmemory: initialise handle->fd
@ 2016-02-03 10:09 Ian Campbell
  2016-02-03 10:15 ` Wei Liu
  0 siblings, 1 reply; 3+ messages in thread
From: Ian Campbell @ 2016-02-03 10:09 UTC (permalink / raw)
  To: ian.jackson, wei.liu2, xen-devel; +Cc: Ian Campbell

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@citrix.com>
---
 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 cfb0a73..6591888 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;
 
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-02-03 11:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-03 10:09 [PATCH] tools: libxencall/foreignmemory: initialise handle->fd Ian Campbell
2016-02-03 10:15 ` Wei Liu
2016-02-03 11:49   ` Ian Campbell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.