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 d20fc04cb07122d1a92600771384feedccf5289d..bc9515217ac3692ed99d226a34cfbc5b026be10d 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 f16efa495e3e8c0bb459b5267000a6a81a54cfc6..39ac22f1adf79e5b2df88313a9f09cb8b7126b16 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 410cd43067f69287dc9d6105db785c22f22e4853..d38212da7b385231fbc9a335a7ba054916efaab7 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 */