Re: [PATCH 1/2] tools/libs/light: numa placement: don't try to free a NULL list of vcpus

2022-01-19 Thread Dario Faggioli
On Mon, 2022-01-17 at 15:56 +, Anthony PERARD wrote: > On Fri, Jan 14, 2022 at 11:22:00PM +, Dario Faggioli wrote: > > > > Also, if we go that way, I guess we want to change > > libxl_cputopology_list_free(), libxl_pcitopology_list_free(), > > libxl_numainfo_list_free(),

Re: [PATCH 1/2] tools/libs/light: numa placement: don't try to free a NULL list of vcpus

2022-01-17 Thread Anthony PERARD
On Fri, Jan 14, 2022 at 11:22:00PM +, Dario Faggioli wrote: > On Thu, 2022-01-13 at 12:05 +, Anthony PERARD wrote: > > On Wed, Jan 12, 2022 at 05:41:36PM +0100, Dario Faggioli wrote: > > > > > 2) there should be nothing to free anyway > > > > The issue here is that it doesn't appear to

Re: [PATCH 1/2] tools/libs/light: numa placement: don't try to free a NULL list of vcpus

2022-01-14 Thread Dario Faggioli
On Thu, 2022-01-13 at 12:05 +, Anthony PERARD wrote: > On Wed, Jan 12, 2022 at 05:41:36PM +0100, Dario Faggioli wrote: > > > 2) there should be nothing to free anyway > > The issue here is that it doesn't appear to be true. Even if "info" > is > NULL, "nr" have an other value than 0, so

Re: [PATCH 1/2] tools/libs/light: numa placement: don't try to free a NULL list of vcpus

2022-01-13 Thread Anthony PERARD
On Wed, Jan 12, 2022 at 05:41:36PM +0100, Dario Faggioli wrote: > If libxl_vcpu_list() returned NULL, we should not call > libxl_numainfo_list_free() as: You mean libxl_vcpuinfo_list_free() ? > 1) it'll fail trying to (double) free() *list This isn't really an issue. free(NULL) is legit, can be

[PATCH 1/2] tools/libs/light: numa placement: don't try to free a NULL list of vcpus

2022-01-12 Thread Dario Faggioli
If libxl_vcpu_list() returned NULL, we should not call libxl_numainfo_list_free() as: 1) it'll fail trying to (double) free() *list 2) there should be nothing to free anyway Signed-off-by: Dario Faggioli Tested-by: James Fehlig --- Cc: Wei Liu Cc: Anthony PERARD Cc: Juergen Gross ---