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: 38caff5a445b ("r8169: handle all interrupt events in the hard irq 
handler")
Signed-off-by: Heiner Kallweit <hkallwe...@gmail.com>
---
 drivers/net/ethernet/realtek/r8169.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/realtek/r8169.c 
b/drivers/net/ethernet/realtek/r8169.c
index bb1847fd6..8462553e3 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -6414,7 +6414,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 &&
-- 
2.19.2

Reply via email to