diff mbox series

[2/2] wifi: wilc1000: always release SDIO host in wilc_sdio_cmd53()

Message ID 20231026141016.71407-2-dmantipov@yandex.ru (mailing list archive)
State Accepted
Commit ebab2723d0bd47ea899d339d54e1c4ac459d18c3
Delegated to: Kalle Valo
Headers show
Series [1/2] wifi: wilc1000: simplify remain on channel support | expand

Commit Message

Dmitry Antipov Oct. 26, 2023, 2:10 p.m. UTC
Ensure 'sdio_release_host()' is always issued on return
from 'wilc_sdio_cmd53()'. Compile tested only.

Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru>
---
 drivers/net/wireless/microchip/wilc1000/sdio.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

Comments

Ajay Singh Oct. 26, 2023, 11:45 p.m. UTC | #1
Thanks Dmitry

On 10/26/23 07:10, Dmitry Antipov wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
> 
> 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>

> ---
>  drivers/net/wireless/microchip/wilc1000/sdio.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/wireless/microchip/wilc1000/sdio.c b/drivers/net/wireless/microchip/wilc1000/sdio.c
> index 87948ba69a22..0d13e3e46e98 100644
> --- a/drivers/net/wireless/microchip/wilc1000/sdio.c
> +++ b/drivers/net/wireless/microchip/wilc1000/sdio.c
> @@ -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)
> --
> 2.41.0
>
diff mbox series

Patch

diff --git a/drivers/net/wireless/microchip/wilc1000/sdio.c b/drivers/net/wireless/microchip/wilc1000/sdio.c
index 87948ba69a22..0d13e3e46e98 100644
--- a/drivers/net/wireless/microchip/wilc1000/sdio.c
+++ b/drivers/net/wireless/microchip/wilc1000/sdio.c
@@ -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)