Re: [PATCH net] net: gianfar: dispose irq mappings on probe failure and device removal
From: Paolo Abeni
Date: Tue Jun 30 2026 - 11:56:43 EST
On 6/27/26 12:52 AM, Rosen Penev wrote:
> irq_of_parse_and_map() creates irqdomain mappings that should be
> balanced with irq_dispose_mapping(). The driver never called
> irq_dispose_mapping(), leaking mappings on probe failure and
> device removal.
>
> Fix by adding irq_dispose_mapping() in free_gfar_dev() and
> expanding its loop from priv->num_grps to MAXGROUPS so the
> error path also catches partially-initialized groups. All
> irqinfo pointers are pre-initialized to NULL in gfar_of_init(),
> making the NULL-guarded walk in free_gfar_dev() safe for every
> scenario.
>
> gfar_parse_group() itself is left as a simple parse function
> with no resource management; cleanup is centralized in the
> caller's error path.
>
> Assisted-by: opencode:big-pickle
> Fixes: b31a1d8b4151 ("gianfar: Convert gianfar to an of_platform_driver")
> Signed-off-by: Rosen Penev <rosenp@xxxxxxxxx>
The PW bot is on holiday, no automated notifications for a while.
Applied, thanks!
/P