# Re: \[PATCH v3\] powerpc/mpic: Fix memory leak of mpic on error paths

- From: Amit Machhiwal \<hidden\>
- Date: 2026-10-06 08:00:31 
- List: linuxppc-dev
- Page: https://ratatoskr.run/linuxppc-dev/2026/10/17697526
- Thread: https://ratatoskr.run/linuxppc-dev/2026/10/17697314/t.md

```text
On 2026/10/06 12:29 PM, Jyoti Gupta wrote:
> mpic_alloc() allocates struct mpic (and optionally the protected
> sources bitmap) but does not free them when mpic_setup_error_int() or
> irq_domain_create_linear() fails, leaking the memory.
> 
> Free the bitmap and the mpic in the common error path before
> dropping the device node reference.
> 
> Fixes: 996983b75ceb ("powerpc/mpic: Search for open-pic device-tree node if NULL")
> Signed-off-by: Jyoti Gupta <redacted>
> ---

Thanks for updating this to use layered error labels.  The patch looks clean and
good to me now.

Reviewed-by: Amit Machhiwal <redacted>

Thanks,
Amit

```
