Skip to content

Commit

Permalink
r8169: fix crash if CONFIG_DEBUG_SHIRQ is enabled
Browse files Browse the repository at this point in the history
If CONFIG_DEBUG_SHIRQ is enabled __free_irq() intentionally fires
a spurious interrupt. This interrupt causes a crash because
tp->dev->phydev is NULL at that time.

Fixes: 38caff5 ("r8169: handle all interrupt events in the hard irq handler")
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Heiner Kallweit authored and David S. Miller committed Dec 12, 2018
1 parent 2f1a9f6 commit ee28b30
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/realtek/r8169.c
Original file line number Diff line number Diff line change
Expand Up @@ -6469,7 +6469,7 @@ static irqreturn_t rtl8169_interrupt(int irq, void *dev_instance)
goto out;
}

if (status & LinkChg)
if (status & LinkChg && tp->dev->phydev)
phy_mac_interrupt(tp->dev->phydev);

if (unlikely(status & RxFIFOOver &&
Expand Down

0 comments on commit ee28b30

Please sign in to comment.