Re: [PATCH] mfd: hi655x-pmic: fix IRQ action memory leak on removal
From: Krzysztof Kozlowski
Date: Tue Oct 27 2026 - 11:41:24 EST
On 27/10/2026 03:46, Guangshuo Li wrote:
> hi655x_pmic_remove() currently removes the regmap IRQ chip before
> removing the MFD child devices. regmap_del_irq_chip() disposes the
> child IRQ mappings and removes their IRQ descriptors.
>
> The hi65xx-powerkey child registers interrupt handlers using
> devm_request_any_context_irq(). During child device removal, the
> device-managed cleanup calls free_irq(), but the corresponding IRQ
> descriptors are no longer available. As a result, the allocated
> struct irqaction objects referenced by irq_desc->action are not
> freed, causing a memory leak.
>
> Remove the MFD child devices first, allowing their device-managed
> IRQ handlers to be released while the IRQ mappings are still valid.
> Then remove the regmap IRQ chip and its IRQ domain.
>
> This issue was found by our static analysis tool under development.
More of postings by bot ignoring any feedback.
Best regards,
Krzysztof