Re: [PATCH] ARM, sched/topology: Check return value of kcalloc()
From: Thorsten Blum
Date: Sat Jun 29 2024 - 00:09:44 EST
On 28. Jun 2024, at 14:55, Russell King (Oracle) <linux@xxxxxxxxxxxxxxx> wrote:
> On Fri, Jun 28, 2024 at 09:43:51PM +0200, Thorsten Blum wrote:
>> Check the return value of kcalloc() and return early if memory
>> allocation fails.
>
> If we fail this allocation even with your fix, how likely is it that the
> system will boot and manage to run userspace?
I thought about panicking, but wasn't sure if it's justified.
But since it would just crash anyway when accessing a NULL pointer
later on, it's probably best to panic() if the memory allocation fails.
I'll submit a v2 shortly.
Thanks,
Thorsten