[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [RFC] libxc: check return values on mmap() and madvise() on xc_alloc_hypercall_buffer()



On Thu, 2014-05-08 at 03:34 -0700, Luis R. Rodriguez wrote:
> On Thu, May 8, 2014 at 3:15 AM, Ian Campbell <Ian.Campbell@xxxxxxxxxx> 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.


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.