|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH 1/4] libxc/xc_linux_osdep.c: Fix return handling for case of mmap failure
On Mon, 2014-07-28 at 12:05 -0400, Don Slutz wrote:
> From: Harry Hart <hhart@xxxxxxxxxxx>
>
> Callers expect NULL on errors not MAP_FAILED.
>
> Signed-off-by: Harry Hart <hhart@xxxxxxxxxxx>
> Signed-off-by: Don Slutz <dslutz@xxxxxxxxxxx>
> ---
> 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?
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |