From: Ian Campbell Subject: Re: [PATCH 1/4] libxc/xc_linux_osdep.c: Fix return handling for case of mmap failure Date: Wed, 30 Jul 2014 12:42:09 +0100 Message-ID: <1406720529.31718.16.camel@kazak.uk.xensource.com> References: <1406563562-24156-1-git-send-email-dslutz@verizon.com> <1406563562-24156-2-git-send-email-dslutz@verizon.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1406563562-24156-2-git-send-email-dslutz@verizon.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: Don Slutz Cc: Daniel De Graaf , Stefano Stabellini , Ian Jackson , Harry Hart , xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Mon, 2014-07-28 at 12:05 -0400, Don Slutz wrote: > From: Harry Hart > > Callers expect NULL on errors not MAP_FAILED. > > Signed-off-by: Harry Hart > Signed-off-by: Don Slutz > --- > tools/libxc/xc_linux_osdep.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/tools/libxc/xc_linux_osdep.c b/tools/libxc/xc_linux_osdep.c > index 86bff3e..9745feb 100644 > --- a/tools/libxc/xc_linux_osdep.c > +++ b/tools/libxc/xc_linux_osdep.c > @@ -102,6 +102,11 @@ static void *linux_privcmd_alloc_hypercall_buffer(xc_interface *xch, xc_osdep_ha > return NULL; > } > > + if (p == MAP_FAILED) { > + PERROR ("linux_privcmd_alloc_hypercall_buffer: mmap failed"); > + return NULL; > + } The return NULL just above in the context is the same check as this. Rebasing mistake?