[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 1/2] tools/libs/light: numa placement: don't try to free a NULL list of vcpus
- To: Dario Faggioli <dfaggioli@xxxxxxxx>
- From: Anthony PERARD <anthony.perard@xxxxxxxxxx>
- Date: Thu, 13 Jan 2022 12:05:34 +0000
- Authentication-results: esa2.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
- Cc: <xen-devel@xxxxxxxxxxxxxxxxxxxx>, James Fehlig <jfehlig@xxxxxxxx>, Wei Liu <wl@xxxxxxx>, Juergen Gross <jgross@xxxxxxxx>
- Delivery-date: Thu, 13 Jan 2022 12:06:05 +0000
- Ironport-data: A9a23:n7vFJK8PWS36OCziQBpqDrUDc3mTJUtcMsCJ2f8bNWPcYEJGY0x3n DdLWmjSOPqPYjSkeNwiYIXloBxUsZCHzNBgHQY9r308E34SpcT7XtnIdU2Y0wF+jyHgoOCLy +1EN7Es+ehtFie0Si9AttENlFEkvU2ybuOU5NXsZ2YhFWeIdA970Ug5w7dg2dYy6TSEK1jlV e3a8pW31GCNg1aYAkpMg05UgEoy1BhakGpwUm0WPZinjneH/5UmJMt3yZWKB2n5WuFp8tuSH I4v+l0bElTxpH/BAvv9+lryn9ZjrrT6ZWBigVIOM0Sub4QrSoXfHc/XOdJFAXq7hQllkPh2x 98cmpWCGT4ZI5bGs/o4V0EGIwxhaPguFL/veRBTsOSWxkzCNXDt3+9vHAc9OohwFuRfWD8Us 6ZCcXZUM07F17neLLGTE4GAguwqKtXrO4UO/Glt1zjDAd4tQIzZQrWM7thdtNs1rp4XTK+CO 5BJAdZpRBD6XSBOKgs1Mr19kfuaj0TfWR54hE3A8MLb5ECMlVcsgdABKuH9ZdiiVchT2EGCq Qru/WvjBQoBHMeC0jfD+XWp7sfNky77XIMdPKal7fMsi1qWrkQfBhQZWlq8pfiRkVOlVpRUL El80jojq+0++VKmSvH5XgakuziUsxgEQd1SHuYmrgaXxcLpDx2xXzZeCGQbMZp/6ZFwFWd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JcEfDH6xmpM RdmsBFebvN5DNB7PoSjjPWL+od
- Ironport-sdr: TYCMsyy1QkiLnOcW1CUNnkkso464a7l0+h0Vi/OBPH2vbrlMFd9S6IWBN2OlqaEQoOioDEzq7I VATkaD4snYOMh+rQGw+TeSECayDlOcVcsXDfBiwMvzb8CecxidDMtmKgZvAyl9nad3IIUn3gkB 0WO9dVyPZ34eNyBk+JJ8qVPnxF8lsiQZ7I/f4x4Z/WkTuXAdoT6SH7P3FV5p/iBDHL96N1HvWg ZNAa8JEcUs1Miqpdj+EKByKAmsyMa4uxHj9vghSghbRSb1TqA2wDEWcn3NenLyojF1k/0DEQzx HkCGS2WB6RZ+6gHL8/agxXzB
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
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 call as many
time as you want.
> 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 libxl_vcpuinfo_list_free()
will try to access random addresses.
> Signed-off-by: Dario Faggioli <dfaggioli@xxxxxxxx>
> Tested-by: James Fehlig <jfehlig@xxxxxxxx>
Can I suggest to make libxl_vcpuinfo_list_free() work a bit better in
case it's "nr" parameter is wrong? It will do nothing if "list" is NULL.
Even if that seems wrong, and the caller should use the correct value.
Also I think it is better to keep the free in the exit path at the end
of the loop.
Thanks,
--
Anthony PERARD
|