From mboxrd@z Thu Jan 1 00:00:00 1970 From: Don Slutz Subject: Re: [PATCH 1/4] libxc/xc_linux_osdep.c: Fix return handling for case of mmap failure Date: Wed, 30 Jul 2014 21:11:12 -0400 Message-ID: <53D997B0.60207@terremark.com> References: <1406563562-24156-1-git-send-email-dslutz@verizon.com> <1406563562-24156-2-git-send-email-dslutz@verizon.com> <1406720529.31718.16.camel@kazak.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1406720529.31718.16.camel@kazak.uk.xensource.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 , 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 07/30/14 07:42, Ian Campbell wrote: > 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? > > > Yup. -Don Slutz