From: Pawel Dembicki Date: Sat, 17 Nov 2018 08:07:47 +0000 (+0000) Subject: ar8216: add adjust_link checking X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=e61812fd346c43edbb16e87e61ff1a2110ca8eeb;p=openwrt%2Fstaging%2Fmkresin.git 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 --- 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; }