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>
This commit is contained in:
parent
00d0cd38fd
commit
98a46d46d1
@ -533,6 +533,9 @@ static int gfar_spauseparam(struct net_device *dev,
|
|||||||
struct gfar __iomem *regs = priv->gfargrp[0].regs;
|
struct gfar __iomem *regs = priv->gfargrp[0].regs;
|
||||||
u32 oldadv, newadv;
|
u32 oldadv, newadv;
|
||||||
|
|
||||||
|
if (!phydev)
|
||||||
|
return -ENODEV;
|
||||||
|
|
||||||
if (!(phydev->supported & SUPPORTED_Pause) ||
|
if (!(phydev->supported & SUPPORTED_Pause) ||
|
||||||
(!(phydev->supported & SUPPORTED_Asym_Pause) &&
|
(!(phydev->supported & SUPPORTED_Asym_Pause) &&
|
||||||
(epause->rx_pause != epause->tx_pause)))
|
(epause->rx_pause != epause->tx_pause)))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user