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@gateworks.com>
This commit is contained in:
Tim Harvey 2017-03-09 16:04:38 -08:00 committed by Felix Fietkau
parent 11eac705c5
commit 08371a2db7
3 changed files with 3 additions and 3 deletions

View File

@ -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 */

View File

@ -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 */

View File

@ -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 */