net: qcom/emac: disable interrupts before calling phy_disconnect
authorTimur Tabi <timur@codeaurora.org>
Fri, 14 Oct 2016 19:14:35 +0000 (14:14 -0500)
committerDavid S. Miller <davem@davemloft.net>
Sat, 15 Oct 2016 21:34:43 +0000 (17:34 -0400)
commit93966b715b32a783a1641f5a385901bbfab04733
tree4e79dc8d5a2f9ba30914935ac1c2080f0efb3b2f
parentf0076436136751359e0886f3302a2a0b3a28ba6e
net: qcom/emac: disable interrupts before calling phy_disconnect

There is a race condition that can occur if EMAC interrupts are
enabled when phy_disconnect() is called.  phy_disconnect() sets
adjust_link to NULL.  When an interrupt occurs, the ISR might
call phy_mac_interrupt(), which wakes up the workqueue function
phy_state_machine().  This function might reference adjust_link,
thereby causing a null pointer exception.

Signed-off-by: Timur Tabi <timur@codeaurora.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/qualcomm/emac/emac-mac.c