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

Re: [Xen-devel] [PATCH] libxl: only free vcpu info list when it is allocated



On Fri, 2016-10-21 at 18:17 +0100, Wei Liu wrote:
> Clang complains nr_dom_vcpus may be used uninitialized after
> 4a6070ea9.
> 
> The real issue is vinfo can be NULL and nr_dom_vcpus remains
> uninitialized if previous call fails.
> 
If it were me doing this, I'd just have initialized nr_dom_vcpus to 0.

This is what I've always done when using libxl_numainfo_list_free(),
which is similar to this (then how did I miss doing it here? Oh,
well... :-/)

And since we're initializing vinfo to NULL already, initializing
nr_dom_vcpus as well makes things look more uniform.

That being said, this amounts to personal taste, you're the maintainer,
and it's not that I can't stand this solution, so:

> Signed-off-by: Wei Liu <wei.liu2@xxxxxxxxxx>
>
Reviewed-by: Dario Faggioli <dario.faggioli@xxxxxxxxxx>

Thanks and Regards,
Dario
-- 
<<This happens because I choose it to happen!>> (Raistlin Majere)
-----------------------------------------------------------------
Dario Faggioli, Ph.D, http://about.me/dario.faggioli
Senior Software Engineer, Citrix Systems R&D Ltd., Cambridge (UK)

Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.