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>
master
Pawel Dembicki 6 years ago committed by John Crispin
parent ed25e3ac02
commit e61812fd34
  1. 3
      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;
}

Loading…
Cancel
Save