ipq40xx: fix NPE related to bogus use of fixed phy
authorChristian Lamparter <chunkeey@gmail.com>
Sat, 9 Mar 2019 19:13:17 +0000 (20:13 +0100)
committerChristian Lamparter <chunkeey@gmail.com>
Tue, 11 Aug 2020 17:09:20 +0000 (19:09 +0200)
This patch fixes a not-fully-debugged NPE that occures because
a fixed-phy is told to resume, which it obviously can't.

Signed-off-by: Christian Lamparter <chunkeey@gmail.com>
target/linux/ipq40xx/patches-4.19/709-fix-npe-in-phy-c.patch [new file with mode: 0644]

diff --git a/target/linux/ipq40xx/patches-4.19/709-fix-npe-in-phy-c.patch b/target/linux/ipq40xx/patches-4.19/709-fix-npe-in-phy-c.patch
new file mode 100644 (file)
index 0000000..c976a5f
--- /dev/null
@@ -0,0 +1,20 @@
+--- a/drivers/net/phy/phy.c
++++ b/drivers/net/phy/phy.c
+@@ -982,13 +982,15 @@ EXPORT_SYMBOL(phy_start);
+ static void phy_link_up(struct phy_device *phydev)
+ {
+-      phydev->phy_link_change(phydev, true, true);
++      if (phydev->phy_link_change)
++              phydev->phy_link_change(phydev, true, true);
+       phy_led_trigger_change_speed(phydev);
+ }
+ static void phy_link_down(struct phy_device *phydev, bool do_carrier)
+ {
+-      phydev->phy_link_change(phydev, false, do_carrier);
++      if (phydev->phy_link_change)
++              phydev->phy_link_change(phydev, false, do_carrier);
+       phy_led_trigger_change_speed(phydev);
+ }