Commit 099a728d authored by xypron.glpk@gmx.de's avatar xypron.glpk@gmx.de Committed by David S. Miller

net: thunderx: avoid null pointer dereference

In function bgx_lmac_handler only use a member of
lmac after checking it is not null.
Signed-off-by: default avatarHeinrich Schuchardt <xypron.glpk@gmx.de>
Acked-by: default avatarDavid Daney <david.daney@cavium.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 07b75260
......@@ -274,12 +274,14 @@ static void bgx_sgmii_change_link_state(struct lmac *lmac)
static void bgx_lmac_handler(struct net_device *netdev)
{
struct lmac *lmac = container_of(netdev, struct lmac, netdev);
struct phy_device *phydev = lmac->phydev;
struct phy_device *phydev;
int link_changed = 0;
if (!lmac)
return;
phydev = lmac->phydev;
if (!phydev->link && lmac->last_link)
link_changed = -1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment