All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ian Campbell <Ian.Campbell@citrix.com>
To: Uma Sharma <uma.sharma523@gmail.com>
Cc: George.Dunlap@eu.citrix.com, Ian.Jackson@citrix.com,
	Wei.Liu2@citrix.com, xen-devel@lists.xen.org
Subject: Re: [OPW PATCH] tools/xl:Making _dispose function simplicity for libxl_dominfo
Date: Mon, 27 Oct 2014 09:47:49 +0000	[thread overview]
Message-ID: <1414403269.31057.1.camel@citrix.com> (raw)
In-Reply-To: <544d43ba.6667460a.14f6.ffff9715@mx.google.com>

On Mon, 2014-10-27 at 00:25 +0530, Uma Sharma wrote:
> This patch simplifies the call to dispose for libxl_dominfo *info.
> _dispose was called multiple times in tools/libxl/xl_cmdimpl.c
> IDL generated libxl types should be used only after calling the init
> function.
> 
> Signed-off-by: Uma Sharma <uma.sharma523@gmail.com>
> --
> diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c
> index 5325a52..9a6ceb3 100644
> --- a/tools/libxl/xl_cmdimpl.c
> +++ b/tools/libxl/xl_cmdimpl.c
> @@ -4375,12 +4375,8 @@ int main_list(int argc, char **argv)
>          list_domains_details(info, nb_domain);
>      else
>          list_domains(verbose, context, 0 /* claim */, numa, info, nb_domain);
> -
> -    if (info_free)
> -        libxl_dominfo_list_free(info, nb_domain);
> -    else
> -	libxl_dominfo_dispose(info);
> -
> +    
> +    libxl_dominfo_list_free(info, nb_domain);

I don't think this is right, libxl_dominfo_list_free will dispose each
of the array members and then free the memory corresponding to the array
itself. But when info_free is false info is a pointer to a static buffer
on the stack, not to a dynamically allocated array.

Even if the change is correct, it doesn't seem to correspond to the
commit message.

Ian.

  reply	other threads:[~2014-10-27  9:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-26 18:55 [OPW PATCH] tools/xl:Making _dispose function simplicity for libxl_dominfo Uma Sharma
2014-10-27  9:47 ` Ian Campbell [this message]
2014-10-27 10:06 ` Andrew Cooper
2014-10-27 21:41   ` Uma Sharma

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=1414403269.31057.1.camel@citrix.com \
    --to=ian.campbell@citrix.com \
    --cc=George.Dunlap@eu.citrix.com \
    --cc=Ian.Jackson@citrix.com \
    --cc=Wei.Liu2@citrix.com \
    --cc=uma.sharma523@gmail.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.