diff options
author | Claudiu Manoil <claudiu.manoil@freescale.com> | 2014-04-23 13:38:47 (GMT) |
---|---|---|
committer | Jose Rivera <German.Rivera@freescale.com> | 2014-05-08 13:51:03 (GMT) |
commit | ddf4bcdcef513cc43ea4d9ba561ab5ce5ea5a609 (patch) | |
tree | 0fbd7ac89ea5ac6a90151330c02e909de69338ce /drivers/net/ethernet/freescale | |
parent | 851b67e8e805acc3e049b558b85b57246d8f8e44 (diff) | |
download | linux-fsl-qoriq-ddf4bcdcef513cc43ea4d9ba561ab5ce5ea5a609.tar.xz |
gianfar: Check if phydev present on ethtool -A
This fixes a seg fault on 'ethtool -A' entry if the
interface is down. Obviously we need to have the
phy device initialized / "connected" (see of_phy_connect())
to be able to advertise pause frame capabilities.
Fixes: 23402bddf9e56eecb27bbd1e5467b3b79b3dbe58
Signed-off-by: Claudiu Manoil <claudiu.manoil@freescale.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Change-Id: I94f1a677dafca91e68029acce120e7417c75ff8f
Reviewed-on: http://git.am.freescale.net:8181/11514
Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com>
Reviewed-by: Jianhua Xie <jianhua.xie@freescale.com>
Reviewed-by: Jose Rivera <German.Rivera@freescale.com>
Diffstat (limited to 'drivers/net/ethernet/freescale')
-rw-r--r-- | drivers/net/ethernet/freescale/gianfar_ethtool.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/ethernet/freescale/gianfar_ethtool.c b/drivers/net/ethernet/freescale/gianfar_ethtool.c index e2bf5d1..2e081da 100644 --- a/drivers/net/ethernet/freescale/gianfar_ethtool.c +++ b/drivers/net/ethernet/freescale/gianfar_ethtool.c @@ -537,6 +537,9 @@ static int gfar_spauseparam(struct net_device *dev, struct gfar __iomem *regs = priv->gfargrp[0].regs; u32 oldadv, newadv; + if (!phydev) + return -ENODEV; + if (!(phydev->supported & SUPPORTED_Pause) || (!(phydev->supported & SUPPORTED_Asym_Pause) && (epause->rx_pause != epause->tx_pause))) |