Re: [PATCH net v2] net: stmmac: unwind the WoL IRQ after a safety IRQ request failure
From: Maxime Chevallier
Date: Tue Oct 06 2026 - 03:54:09 EST
Hi,
On 10/6/26 09:06, James Hilliard wrote:
> The safety IRQ is requested after the MAC and optional WoL IRQs. If its
> request fails, stmmac_free_irq() frees the unregistered safety IRQ and
> leaks the WoL handler. This can warn about an already-free IRQ and make
> the next open fail.
>
> Move the safety and WoL cleanup labels into reverse acquisition order.
>
> Fixes: 5c2215167d12 ("net: stmmac: Add driver support for common safety IRQ")
> Signed-off-by: James Hilliard <james.hilliard1@xxxxxxxxx>
> Reviewed-by: Nicolai Buchwitz <nb@xxxxxxxxxxx>
Reviewed-by: Maxime Chevallier <maxime.chevallier@xxxxxxxxxxx>
Maxime
> ---
> Changes in v2:
> - Drop the claim that later per-queue IRQ failures also had broken
> cleanup; those paths already released both IRQs.
> - Add Nicolai Buchwitz's Reviewed-by.
> - Link to v1: https://patch.msgid.link/20260930-stmmac-irq-unwind-v1-1-0c8a053761c7@xxxxxxxxx
> ---
> drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> index b837e8e27a35..0403d434c9b9 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
> @@ -3799,13 +3799,13 @@ static void stmmac_free_irq(struct net_device *dev,
> free_irq(msi->sfty_ce_irq, dev);
> fallthrough;
> case REQ_IRQ_ERR_SFTY_CE:
> - if (priv->wol_irq > 0 && priv->wol_irq != dev->irq)
> - free_irq(priv->wol_irq, dev);
> - fallthrough;
> - case REQ_IRQ_ERR_SFTY:
> if (priv->sfty_irq > 0 && priv->sfty_irq != dev->irq)
> free_irq(priv->sfty_irq, dev);
> fallthrough;
> + case REQ_IRQ_ERR_SFTY:
> + if (priv->wol_irq > 0 && priv->wol_irq != dev->irq)
> + free_irq(priv->wol_irq, dev);
> + fallthrough;
> case REQ_IRQ_ERR_WOL:
> free_irq(dev->irq, dev);
> fallthrough;
>
> ---
> base-commit: d5a007b9b457c915ab1a53227e8939e4018aa97a
> change-id: 20260930-stmmac-irq-unwind-0be86901638d
>
> Best regards,
> --
> James Hilliard <james.hilliard1@xxxxxxxxx>