All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Wei Liu <wei.liu2@citrix.com>
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>,
	Ian Campbell <Ian.Campbell@citrix.com>,
	Xen-devel <xen-devel@lists.xen.org>
Subject: Re: [PATCH] tools/libxl: Correct use of phyinfo_{init, dispose}()
Date: Tue, 4 Aug 2015 22:27:25 +0100	[thread overview]
Message-ID: <55C12E3D.4000502@citrix.com> (raw)
In-Reply-To: <20150804212512.GA31528@zion.uk.xensource.com>

On 04/08/2015 22:25, Wei Liu wrote:
> On Tue, Aug 04, 2015 at 07:58:38PM +0100, Andrew Cooper wrote:
>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
>> ---
> [...]
>> index bfc9699..13dc2de 100644
>> --- a/tools/libxl/libxl_utils.c
>> +++ b/tools/libxl/libxl_utils.c
>> @@ -848,11 +848,10 @@ int libxl__count_physical_sockets(libxl__gc *gc, int *sockets)
>>      libxl_physinfo_init(&info);
>>  
>>      rc = libxl_get_physinfo(CTX, &info);
>> -    if (rc)
>> -        return rc;
>> -
>> -    *sockets = info.nr_cpus / info.threads_per_core
>> -                            / info.cores_per_socket;
>> +    if (!rc) {
>> +        *sockets = info.nr_cpus / info.threads_per_core
>> +                                / info.cores_per_socket;
>> +    }
>>  
>>      libxl_physinfo_dispose(&info);
>>      return 0;
> This should return rc.

Coverity spotted that too.  It is fixed in v2 which I havn't posted yet,
mainly pending the maintainers decision as to whether this patch is
worth persuing for 4.6 or not.

~Andrew

  reply	other threads:[~2015-08-04 21:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-04 18:58 [PATCH] tools/libxl: Correct use of phyinfo_{init, dispose}() Andrew Cooper
2015-08-04 21:25 ` Wei Liu
2015-08-04 21:27   ` Andrew Cooper [this message]
2015-08-05  8:40 ` Ian Campbell
2015-08-05  8:52   ` Andrew Cooper

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=55C12E3D.4000502@citrix.com \
    --to=andrew.cooper3@citrix.com \
    --cc=Ian.Campbell@citrix.com \
    --cc=Ian.Jackson@eu.citrix.com \
    --cc=wei.liu2@citrix.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.