wlcore: Fix unbalanced interrupts enablement
authorIdo Yariv <ido@wizery.com>
Wed, 15 Aug 2012 15:29:04 +0000 (18:29 +0300)
committerLuciano Coelho <luca@coelho.fi>
Thu, 27 Sep 2012 09:13:53 +0000 (12:13 +0300)
The interrupt line is enabled by wl12xx_enable_interrupts and
wl18xx_enable_interrupts, but it will not be disabled in all failure
paths. Fix this.

Signed-off-by: Ido Yariv <ido@wizery.com>
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Luciano Coelho <luca@coelho.fi>
drivers/net/wireless/ti/wl12xx/main.c
drivers/net/wireless/ti/wl18xx/main.c

index f49ce7c633b6d26c9f8d275aee1cbaffc7ee3666..630b4d4cea046789c26df43c1e7b212f2702388b 100644 (file)
@@ -1184,9 +1184,16 @@ static int wl12xx_enable_interrupts(struct wl1271 *wl)
        ret = wlcore_write_reg(wl, REG_INTERRUPT_MASK,
                               WL1271_ACX_INTR_ALL & ~(WL12XX_INTR_MASK));
        if (ret < 0)
-               goto out;
+               goto disable_interrupts;
 
        ret = wlcore_write32(wl, WL12XX_HI_CFG, HI_CFG_DEF_VAL);
+       if (ret < 0)
+               goto disable_interrupts;
+
+       return ret;
+
+disable_interrupts:
+       wlcore_disable_interrupts(wl);
 
 out:
        return ret;
index fa7e6ef3f6a2229e06ca66643601e3b77eb67a26..9bf2d8755c5b75cdb075db2e8532e0f5579ac7a0 100644 (file)
@@ -811,6 +811,13 @@ static int wl18xx_enable_interrupts(struct wl1271 *wl)
 
        ret = wlcore_write_reg(wl, REG_INTERRUPT_MASK,
                               WL1271_ACX_INTR_ALL & ~intr_mask);
+       if (ret < 0)
+               goto disable_interrupts;
+
+       return ret;
+
+disable_interrupts:
+       wlcore_disable_interrupts(wl);
 
 out:
        return ret;