[PATCH] ARM, sched/topology: Check return value of kcalloc()

Thorsten Blum thorsten.blum at toblux.com
Fri Jun 28 21:09:22 PDT 2024


On 28. Jun 2024, at 14:55, Russell King (Oracle) <linux at armlinux.org.uk> 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


More information about the linux-arm-kernel mailing list