From e61812fd346c43edbb16e87e61ff1a2110ca8eeb Mon Sep 17 00:00:00 2001 From: Pawel Dembicki Date: Sat, 17 Nov 2018 08:07:47 +0000 Subject: [PATCH] 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 --- target/linux/generic/files/drivers/net/phy/ar8216.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/target/linux/generic/files/drivers/net/phy/ar8216.c b/target/linux/generic/files/drivers/net/phy/ar8216.c index 7512ee1b43d5..6869e1ff191c 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; } -- 2.30.2