From patchwork Thu Oct 26 14:10:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Antipov X-Patchwork-Id: 739233 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DA718C25B67 for ; Thu, 26 Oct 2023 14:11:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235017AbjJZOLz (ORCPT ); Thu, 26 Oct 2023 10:11:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44916 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230507AbjJZOLy (ORCPT ); Thu, 26 Oct 2023 10:11:54 -0400 Received: from forward102a.mail.yandex.net (forward102a.mail.yandex.net [IPv6:2a02:6b8:c0e:500:1:45:d181:d102]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A13831AA for ; Thu, 26 Oct 2023 07:11:49 -0700 (PDT) Received: from mail-nwsmtp-smtp-production-main-64.vla.yp-c.yandex.net (mail-nwsmtp-smtp-production-main-64.vla.yp-c.yandex.net [IPv6:2a02:6b8:c0f:170e:0:640:d60c:0]) by forward102a.mail.yandex.net (Yandex) with ESMTP id 6C33160030; Thu, 26 Oct 2023 17:11:47 +0300 (MSK) Received: by mail-nwsmtp-smtp-production-main-64.vla.yp-c.yandex.net (smtp/Yandex) with ESMTPSA id kBR2w36DV8c0-MpVWPlNu; Thu, 26 Oct 2023 17:11:47 +0300 X-Yandex-Fwd: 1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1698329507; bh=6EvCt7EfDSENJKxxIjMJGNpPc2FJSlZha5HbjeHUvLE=; h=Message-ID:Date:In-Reply-To:Cc:Subject:References:To:From; b=OMEnDEhUFLmT+igYu64wq0/ZPeiGiFqRm1Dbfb+GydTdhLWxah5uXHkY4o8ClDYXA 59dUGmDgac+H4mnloMU4gMFCOA+08Q58IIOp9AaE0XWqXhswGMD2X141iG3uI4qDqe 5Icf4dlueb3Hked7YWQmY4ai9nGtHWilGOc0XjYA= Authentication-Results: mail-nwsmtp-smtp-production-main-64.vla.yp-c.yandex.net; dkim=pass header.i=@yandex.ru From: Dmitry Antipov To: Ajay Singh Cc: Claudiu Beznea , Kalle Valo , linux-wireless@vger.kernel.org, Dmitry Antipov Subject: [PATCH 2/2] wifi: wilc1000: always release SDIO host in wilc_sdio_cmd53() Date: Thu, 26 Oct 2023 17:10:12 +0300 Message-ID: <20231026141016.71407-2-dmantipov@yandex.ru> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231026141016.71407-1-dmantipov@yandex.ru> References: <20231026141016.71407-1-dmantipov@yandex.ru> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org Ensure 'sdio_release_host()' is always issued on return from 'wilc_sdio_cmd53()'. Compile tested only. Signed-off-by: Dmitry Antipov --- 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)