All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu2@citrix.com>
To: Tiejun Chen <tiejun.chen@intel.com>
Cc: ian.jackson@eu.citrix.com, xen-devel@lists.xen.org,
	wei.liu2@citrix.com, ian.campbell@citrix.com,
	stefano.stabellini@eu.citrix.com
Subject: Re: [PATCH] tools/libxl: cleanup one libxl__calloc() usage
Date: Tue, 10 Mar 2015 09:21:46 +0000	[thread overview]
Message-ID: <20150310092146.GA4330@zion.uk.xensource.com> (raw)
In-Reply-To: <1425968896-27199-1-git-send-email-tiejun.chen@intel.com>

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@intel.com>

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

> ---
>  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

  reply	other threads:[~2015-03-10  9:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-10  6:28 [PATCH] tools/libxl: cleanup one libxl__calloc() usage Tiejun Chen
2015-03-10  9:21 ` Wei Liu [this message]
2015-03-11 12:30   ` Ian Campbell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150310092146.GA4330@zion.uk.xensource.com \
    --to=wei.liu2@citrix.com \
    --cc=ian.campbell@citrix.com \
    --cc=ian.jackson@eu.citrix.com \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=tiejun.chen@intel.com \
    --cc=xen-devel@lists.xen.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.