Re: [PATCH] irqdesc: Fail check on early_irq_init allocation.

From: Marc Zyngier
Date: Sun Nov 12 2023 - 09:06:02 EST


On Sat, 11 Nov 2023 17:00:36 +0000,
Paran Lee <p4ranlee@xxxxxxxxx> wrote:
>
> When doing start_kernel(),
> On early_irq_init(), alloc_desc() or alloc_percpu()
> may be fails. So, Explicit fail check needed on dynamic allocation.

A failing allocation already results in a massive splat describing how
the allocation failed. Further use of the NULL pointer will also
result in a terminal oops, particularly if this happens this early in
the boot sequence.

So what do these BUG_ON() calls buy us?

M.

--
Without deviation from the norm, progress is not possible.