From: Ian Campbell Subject: Re: [RFC] libxc: check return values on mmap() and madvise() on xc_alloc_hypercall_buffer() Date: Mon, 12 May 2014 13:03:04 +0100 Message-ID: <1399896184.22097.9.camel@kazak.uk.xensource.com> References: <1399499244-4421-1-git-send-email-mcgrof@do-not-panic.com> <536AAF3F.3070700@citrix.com> <20140508050320.GD13289@wotan.suse.de> <1399544125.9513.37.camel@kazak.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Wjown-0002EE-P8 for xen-devel@lists.xenproject.org; Mon, 12 May 2014 12:03:09 +0000 In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: "Luis R. Rodriguez" Cc: Andrew Cooper , Ian Jackson , xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org On Thu, 2014-05-08 at 03:34 -0700, Luis R. Rodriguez wrote: > On Thu, May 8, 2014 at 3:15 AM, Ian Campbell wrote: > > The out label idiom you have used is pretty conventional and will save > > faff if some other operation gets added here. I'm happy with the patch > > as it is. > > OK feel free to take it then. I hadn't noticed that there was a failure specific PERROR at the out label location. For this to make sense it would need to be: rc = madvise(p, npages * XC_PAGE_SIZE, MADV_DONTFORK); if ( rc < 0 ) { PERROR("xc_alloc_hypercall_buffer: madvise failed"); goto out; } .... out: the cleanup Ian.