提交 099a728d 编写于 作者: X xypron.glpk@gmx.de 提交者: 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: NHeinrich Schuchardt <xypron.glpk@gmx.de>
Acked-by: NDavid Daney <david.daney@cavium.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册