Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 98a46d46 authored by Claudiu Manoil's avatar Claudiu Manoil Committed by David S. Miller
Browse files

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: 23402bdd
Signed-off-by: default avatarClaudiu Manoil <claudiu.manoil@freescale.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 00d0cd38
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -533,6 +533,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)))