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

From: Paran Lee
Date: Sun Nov 12 2023 - 09:19:42 EST




On 2023-11-12 오후 11:00, Marc Zyngier wrote:

Thanks for the code review Marc!

I think function alloc_descs() in irqdesc.c has also alloc_desc() fail
handling, and there's kernel-wide code consistency checking for
allocation failures, and I thought it would be nice to mark it.
So that the code is aware of it.

Even if it panics with a null derefence reference.

> 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.
>

If anyone has any ideas on how to get a little fancier with the allocation,
I'll send a v2 patch in that direction.

BR
Paran Lee