kernel: fix phy aneg crash
authorTim Harvey <tharvey@gateworks.com>
Fri, 10 Mar 2017 00:04:38 +0000 (16:04 -0800)
committerFelix Fietkau <nbd@nbd.name>
Sun, 12 Mar 2017 10:58:45 +0000 (11:58 +0100)
Fix a kernel crash caused when CONFIG_FIXED_PHY used for fixed phy drivers
in phy-add-aneg-done-function patch.

Signed-off-by: Tim Harvey <tharvey@gateworks.com>
target/linux/generic/patches-3.18/702-phy_add_aneg_done_function.patch
target/linux/generic/patches-4.4/702-phy_add_aneg_done_function.patch
target/linux/generic/patches-4.9/702-phy_add_aneg_done_function.patch

index d20fc04..bc95152 100644 (file)
@@ -19,7 +19,7 @@
  {
        int status;
  
-+      if (phydev->drv->update_link)
++      if (phydev->drv && phydev->drv->update_link)
 +              return phydev->drv->update_link(phydev);
 +
        /* Do a fake read */
index f16efa4..39ac22f 100644 (file)
@@ -19,7 +19,7 @@
  {
        int status;
  
-+      if (phydev->drv->update_link)
++      if (phydev->drv && phydev->drv->update_link)
 +              return phydev->drv->update_link(phydev);
 +
        /* Do a fake read */
index 410cd43..d38212d 100644 (file)
@@ -19,7 +19,7 @@
  {
        int status;
  
-+      if (phydev->drv->update_link)
++      if (phydev->drv && phydev->drv->update_link)
 +              return phydev->drv->update_link(phydev);
 +
        /* Do a fake read */