Re: [PATCH] [irqchip] mips-cpu: Add error handling in mips_cpu_register_ipi_domain

From: Thomas Gleixner
Date: Fri Dec 08 2023 - 09:13:25 EST


On Wed, Nov 29 2023 at 20:06, Haoran Liu wrote:

The subject line:

https://www.kernel.org/doc/html/latest/process/maintainer-tip.html#patch-subject

> This patch enhances the mips_cpu_register_ipi_domain function in

# git grep 'This patch' Documentation/process/

> drivers/irqchip/irq-mips-cpu.c by adding error handling for the
> kzalloc

The file name is irrelevant. Please read and follow:

https://www.kernel.org/doc/html/latest/process/maintainer-tip.html

> call. Previously, the function lacked proper handling for kzalloc
> failures, which could lead to potential null pointer dereference issues
> under low memory conditions.

The value of this "enhancement" is dubious. if that kzalloc() fails then
any subsequent allocation will fail too and the machine will crash
anyway.