Commit 099a728d authored by Heinrich Schuchardt's avatar Heinrich Schuchardt 💬 Committed by David S. Miller
Browse files

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: Heinrich Schuchardt's avatarHeinrich Schuchardt <>
Acked-by: default avatarDavid Daney <>
Signed-off-by: default avatarDavid S. Miller <>
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)
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