aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic/files/drivers/net
diff options
context:
space:
mode:
authorPawel Dembicki <paweldembicki@gmail.com>2018-11-17 08:07:47 +0000
committerJohn Crispin <john@phrozen.org>2018-11-26 12:16:52 +0100
commite61812fd346c43edbb16e87e61ff1a2110ca8eeb (patch)
tree24f2ffb25eba30a12f86b856deaf346599b0457f /target/linux/generic/files/drivers/net
parented25e3ac02d9193d7cba89563a88b8bccc4b4513 (diff)
downloadupstream-e61812fd346c43edbb16e87e61ff1a2110ca8eeb.tar.gz
upstream-e61812fd346c43edbb16e87e61ff1a2110ca8eeb.tar.bz2
upstream-e61812fd346c43edbb16e87e61ff1a2110ca8eeb.zip
ar8216: add adjust_link checking
Driver crash when 'phydev->adjust_link' isn't provided. This patch check if 'phydev->adjust_link' exist before call the method. Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com>
Diffstat (limited to 'target/linux/generic/files/drivers/net')
-rw-r--r--target/linux/generic/files/drivers/net/phy/ar8216.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/target/linux/generic/files/drivers/net/phy/ar8216.c b/target/linux/generic/files/drivers/net/phy/ar8216.c
index 7512ee1b43..6869e1ff19 100644
--- a/target/linux/generic/files/drivers/net/phy/ar8216.c
+++ b/target/linux/generic/files/drivers/net/phy/ar8216.c
@@ -2104,7 +2104,8 @@ ar8xxx_phy_read_status(struct phy_device *phydev)
phydev->state = PHY_RUNNING;
netif_carrier_on(phydev->attached_dev);
- phydev->adjust_link(phydev->attached_dev);
+ if (phydev->adjust_link)
+ phydev->adjust_link(phydev->attached_dev);
return 0;
}