]> Git Repo - linux.git/commitdiff
staging: wilc1000: Fix some double unlock bugs in wilc_wlan_cleanup()
authorDan Carpenter <[email protected]>
Wed, 15 May 2019 09:52:23 +0000 (12:52 +0300)
committerGreg Kroah-Hartman <[email protected]>
Mon, 20 May 2019 07:26:04 +0000 (09:26 +0200)
If ->hif_read_reg() or ->hif_write_reg() fail then the code unlocks
and keeps executing.  It should just return.

Fixes: c5c77ba18ea6 ("staging: wilc1000: Add SDIO/SPI 802.11 driver")
Signed-off-by: Dan Carpenter <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
drivers/staging/wilc1000/wilc_wlan.c

index 0a713409ea98225f4cfd46071ac2005eea1e622e..95eaf8fdf4f23b17778abcd2a2d8c1ca291986ef 100644 (file)
@@ -1076,13 +1076,17 @@ void wilc_wlan_cleanup(struct net_device *dev)
        acquire_bus(wilc, WILC_BUS_ACQUIRE_AND_WAKEUP);
 
        ret = wilc->hif_func->hif_read_reg(wilc, WILC_GP_REG_0, &reg);
-       if (!ret)
+       if (!ret) {
                release_bus(wilc, WILC_BUS_RELEASE_ALLOW_SLEEP);
+               return;
+       }
 
        ret = wilc->hif_func->hif_write_reg(wilc, WILC_GP_REG_0,
                                        (reg | ABORT_INT));
-       if (!ret)
+       if (!ret) {
                release_bus(wilc, WILC_BUS_RELEASE_ALLOW_SLEEP);
+               return;
+       }
 
        release_bus(wilc, WILC_BUS_RELEASE_ALLOW_SLEEP);
        wilc->hif_func->hif_deinit(NULL);
This page took 0.047882 seconds and 4 git commands to generate.