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

Re: [Xen-devel] [PATCH] tools/libxl: cleanup one libxl__calloc() usage



On Tue, Mar 10, 2015 at 02:28:16PM +0800, Tiejun Chen wrote:
> Its pointless because internally, libxl__calloc() would always
> terminate program execution if failed,
> 
> libxl__calloc()
>     |
>     + void *ptr = calloc(nmemb, size);
>     + if (!ptr) libxl__alloc_failed(CTX, __func__, nmemb, size);
>                     |
>                     + _exit(-1);
> 
> Signed-off-by: Tiejun Chen <tiejun.chen@xxxxxxxxx>

Acked-by: Wei Liu <wei.liu2@xxxxxxxxxx>

> ---
>  tools/libxl/libxl_dm.c | 4 ----
>  1 file changed, 4 deletions(-)
> 
> diff --git a/tools/libxl/libxl_dm.c b/tools/libxl/libxl_dm.c
> index 8599a6a..cb006df 100644
> --- a/tools/libxl/libxl_dm.c
> +++ b/tools/libxl/libxl_dm.c
> @@ -1175,10 +1175,6 @@ static void spawn_stub_launch_dm(libxl__egc *egc,
>          num_console++;
>  
>      console = libxl__calloc(gc, num_console, sizeof(libxl__device_console));
> -    if (!console) {
> -        ret = ERROR_NOMEM;
> -        goto out;
> -    }
>  
>      for (i = 0; i < num_console; i++) {
>          libxl__device device;
> -- 
> 1.9.1

_______________________________________________
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®.