[source] kernel: fix phy aneg crash

LEDE Commits lede-commits at lists.infradead.org
Sun Mar 12 03:58:52 PDT 2017


nbd pushed a commit to source.git, branch master:
https://git.lede-project.org/08371a2db76ecba5236ae8aec1d57fee84e312d8

commit 08371a2db76ecba5236ae8aec1d57fee84e312d8
Author: Tim Harvey <tharvey at gateworks.com>
AuthorDate: Thu Mar 9 16:04:38 2017 -0800

    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 <tharvey at gateworks.com>
---
 target/linux/generic/patches-3.18/702-phy_add_aneg_done_function.patch | 2 +-
 target/linux/generic/patches-4.4/702-phy_add_aneg_done_function.patch  | 2 +-
 target/linux/generic/patches-4.9/702-phy_add_aneg_done_function.patch  | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

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 d20fc04..bc95152 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 f16efa4..39ac22f 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 410cd43..d38212d 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 */



More information about the lede-commits mailing list