Re: [PATCH] alpha: add null pointer check

From: Al Viro
Date: Sat Apr 02 2022 - 11:45:49 EST


On Sat, Apr 02, 2022 at 08:34:36AM +0000, cgel.zte@xxxxxxxxx wrote:
> From: Lv Ruyi <lv.ruyi@xxxxxxxxxx>
>
> kmalloc is a memory allocation function which can return NULL when some
> internal memory errors happen. Add null pointer check to avoid
> dereferencing null pointer.

Why is that fix correct? The only caller (module_frob_arch_sections())
has no way to tell we'd failed. _IF_ ignoring the failure is the right
thing to do, the analysis needs to be covered in commit message.