]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wifi: wilc1000: always release SDIO host in wilc_sdio_cmd53()
authorDmitry Antipov <dmantipov@yandex.ru>
Thu, 26 Oct 2023 14:10:12 +0000 (17:10 +0300)
committerKalle Valo <kvalo@kernel.org>
Mon, 30 Oct 2023 17:23:51 +0000 (19:23 +0200)
Ensure 'sdio_release_host()' is always issued on return
from 'wilc_sdio_cmd53()'. Compile tested only.

Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
Acked-by: Ajay Singh <ajay.kathat@microchip.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20231026141016.71407-2-dmantipov@yandex.ru
drivers/net/wireless/microchip/wilc1000/sdio.c

index 87948ba69a222f374b05f28662f5ef5214519805..0d13e3e46e98e4b59852811324792793fc27f78e 100644 (file)
@@ -106,9 +106,10 @@ static int wilc_sdio_cmd53(struct wilc *wilc, struct sdio_cmd53 *cmd)
                size = cmd->count;
 
        if (cmd->use_global_buf) {
-               if (size > sizeof(u32))
-                       return -EINVAL;
-
+               if (size > sizeof(u32)) {
+                       ret = -EINVAL;
+                       goto out;
+               }
                buf = sdio_priv->cmd53_buf;
        }
 
@@ -123,7 +124,7 @@ static int wilc_sdio_cmd53(struct wilc *wilc, struct sdio_cmd53 *cmd)
                if (cmd->use_global_buf)
                        memcpy(cmd->buffer, buf, size);
        }
-
+out:
        sdio_release_host(func);
 
        if (ret)