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

Commit c98b0537 authored by Timur Tabi's avatar Timur Tabi Committed by David S. Miller
Browse files

net: qcom/emac: fix double free of SGMII IRQ during shutdown



If the interface is not up, then don't try to close it during a
shutdown.  This avoids possible double free of the IRQ, which
can happen during a shutdown.

Fixes: 03eb3eb4 ("net: qcom/emac: add shutdown function")
Signed-off-by: default avatarTimur Tabi <timur@codeaurora.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a8f5cb9e
Loading
Loading
Loading
Loading
+6 −4
Original line number Diff line number Diff line
@@ -766,12 +766,14 @@ static void emac_shutdown(struct platform_device *pdev)
	struct emac_adapter *adpt = netdev_priv(netdev);
	struct emac_sgmii *sgmii = &adpt->phy;

	if (netdev->flags & IFF_UP) {
		/* Closing the SGMII turns off its interrupts */
		sgmii->close(adpt);

		/* Resetting the MAC turns off all DMA and its interrupts */
		emac_mac_reset(adpt);
	}
}

static struct platform_driver emac_platform_driver = {
	.probe	= emac_probe,