Re: [PATCH net v3 2/4] net: dsa: microchip: ptp: Fix checks on irq_find_mapping()
From: Andrew Lunn
Date: Fri Nov 14 2025 - 09:51:39 EST
On Fri, Nov 14, 2025 at 08:20:21AM +0100, Bastien Curutchet (Schneider Electric) wrote:
> irq_find_mapping() returns a positive IRQ number or 0 if no IRQ is found
> but it never returns a negative value. However, during the PTP IRQ setup,
> we verify that its returned value isn't negative.
>
> Fix the irq_find_mapping() check to enter the error path when 0 is
> returned. Return -EINVAL in such case.
>
> Fixes: cc13ab18b201 ("net: dsa: microchip: ptp: enable interrupt for timestamping")
> Signed-off-by: Bastien Curutchet (Schneider Electric) <bastien.curutchet@xxxxxxxxxxx>
Reviewed-by: Andrew Lunn <andrew@xxxxxxx>
Andrew