From: Tim Harvey Date: Fri, 10 Mar 2017 00:04:38 +0000 (-0800) Subject: kernel: fix phy aneg crash X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=08371a2db76ecba5236ae8aec1d57fee84e312d8;p=openwrt%2Fstaging%2Fthess.git kernel: fix phy aneg crash 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 --- diff --git a/target/linux/generic/patches-3.18/702-phy_add_aneg_done_function.patch b/target/linux/generic/patches-3.18/702-phy_add_aneg_done_function.patch index d20fc04cb0..bc9515217a 100644 --- a/target/linux/generic/patches-3.18/702-phy_add_aneg_done_function.patch +++ b/target/linux/generic/patches-3.18/702-phy_add_aneg_done_function.patch @@ -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 */ diff --git a/target/linux/generic/patches-4.4/702-phy_add_aneg_done_function.patch b/target/linux/generic/patches-4.4/702-phy_add_aneg_done_function.patch index f16efa495e..39ac22f1ad 100644 --- a/target/linux/generic/patches-4.4/702-phy_add_aneg_done_function.patch +++ b/target/linux/generic/patches-4.4/702-phy_add_aneg_done_function.patch @@ -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 */ diff --git a/target/linux/generic/patches-4.9/702-phy_add_aneg_done_function.patch b/target/linux/generic/patches-4.9/702-phy_add_aneg_done_function.patch index 410cd43067..d38212da7b 100644 --- a/target/linux/generic/patches-4.9/702-phy_add_aneg_done_function.patch +++ b/target/linux/generic/patches-4.9/702-phy_add_aneg_done_function.patch @@ -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 */