[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH for-4.6 02/13] libxl: properly clean up array in libxl_list_cpupool failure path
On Thu, 2015-07-23 at 10:22 +0100, Ian Campbell wrote: > On Thu, 2015-07-23 at 08:59 +0100, Wei Liu wrote: > > There is change of behaviour. Previously if memory allocation fails > > the > > said function returns NULL. Now memory allocation failure is fatal. > > This > > is in line with how we deal with memory allocation failure in other > > places in libxl though. > > I think this function would benefit from making the out: label be the > error path and the success case just a return ptr (just before the > label). > > Then your error handling for cpupool_info would become > libxl_cpupoolinfo_dispose(&info); > if (errno != ENOENT) goto out; > break; > > and the "if (failed)" block would be at the out label (without the > iff). > I was about to give my Reviewed-by, but yes, I like Ian's suggestion too. In any case, apart from how error handling is done, I think this patch is fine, as far as dealing with cpupools goes. 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 _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |