From: Maxime Ripard Date: Mon, 23 Jun 2014 20:49:40 +0000 (+0200) Subject: net: allwinner: emac: Add missing free_irq X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b91113282bf44df46aba374a0b8f88a75bfd4b3f;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git net: allwinner: emac: Add missing free_irq If the mdio probe function fails in emac_open, the interrupt we just requested isn't freed. If emac_open is called again, for example because we try to set up the interface again, the kernel will oops because the interrupt wasn't properly released. Signed-off-by: Maxime Ripard Cc: # 3.11+ Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/allwinner/sun4i-emac.c b/drivers/net/ethernet/allwinner/sun4i-emac.c index 28460676b8ca..d81e7167a8b5 100644 --- a/drivers/net/ethernet/allwinner/sun4i-emac.c +++ b/drivers/net/ethernet/allwinner/sun4i-emac.c @@ -736,6 +736,7 @@ static int emac_open(struct net_device *dev) ret = emac_mdio_probe(dev); if (ret < 0) { + free_irq(dev->irq, dev); netdev_err(dev, "cannot probe MDIO bus\n"); return ret; }