Message ID | 1403556580-21818-1-git-send-email-maxime.ripard@free-electrons.com |
---|---|
State | Accepted, archived |
Delegated to: | David Miller |
Headers | show |
From: Maxime Ripard <maxime.ripard@free-electrons.com> Date: Mon, 23 Jun 2014 22:49:40 +0200 > 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 <maxime.ripard@free-electrons.com> > Cc: <stable@vger.kernel.org> # 3.11+ Applied, thank you. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
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; }
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 <maxime.ripard@free-electrons.com> Cc: <stable@vger.kernel.org> # 3.11+ --- drivers/net/ethernet/allwinner/sun4i-emac.c | 1 + 1 file changed, 1 insertion(+)