From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wei Liu Subject: Re: [PATCH] tools: libxencall/foreignmemory: initialise handle->fd Date: Wed, 3 Feb 2016 10:15:20 +0000 Message-ID: <20160203101520.GC23178@citrix.com> References: <1454494182-14767-1-git-send-email-ian.campbell@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: <1454494182-14767-1-git-send-email-ian.campbell@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Campbell Cc: wei.liu2@citrix.com, ian.jackson@eu.citrix.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Wed, Feb 03, 2016 at 10:09:42AM +0000, Ian Campbell wrote: > Otherwise the osdep close on the error path touches an uninitialised > varialble. > > CID: 1351231 (foreignmemory) and 1351230 (call) > > Signed-off-by: Ian Campbell Acked-by: Wei Liu > --- > 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 >