Re: [PATCH v2 1/9] selftests/resctrl: Return NULL if malloc_and_init_memory() did not alloc mem

From: Reinette Chatre
Date: Wed Mar 15 2023 - 19:59:50 EST


Hi Ilpo,

On 2/15/2023 5:05 AM, Ilpo Järvinen wrote:
> malloc_and_init_memory() in fill_buf isn't checking if memalign()
> successfully allocated memory or not before accessing the memory.
>
> Check the return value of memalign() and return NULL if allocating
> aligned memory fails.
>
> Fixes: a2561b12fe39 ("selftests/resctrl: Add built in benchmark")
> Co-developed-by: Fenghua Yu <fenghua.yu@xxxxxxxxx>
> Signed-off-by: Fenghua Yu <fenghua.yu@xxxxxxxxx>
> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@xxxxxxxxxxxxxxx>
> ---

Thank you.

Reviewed-by: Reinette Chatre <reinette.chatre@xxxxxxxxx>

Reinette