lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <6ec0735e-d735-45e0-9d6c-e79fe3a11a21@web.de>
Date: Fri, 20 Sep 2024 15:45:08 +0200
From: Markus Elfring <Markus.Elfring@....de>
To: ath10k@...ts.infradead.org, linux-wireless@...r.kernel.org,
 Erik Stromdahl <erik.stromdahl@...il.com>, Jeff Johnson
 <jjohnson@...nel.org>, Kalle Valo <kvalo@...nel.org>
Cc: LKML <linux-kernel@...r.kernel.org>, Julia Lawall <julia.lawall@...ia.fr>
Subject: [PATCH] ath10k: Use sdio_release_host() call only once in two
 functions

From: Markus Elfring <elfring@...rs.sourceforge.net>
Date: Fri, 20 Sep 2024 15:36:19 +0200

A sdio_release_host() call was immediately used after a return code check
in two function implementations.
Thus use such a function call only once instead directly before the checks.

This issue was transformed by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
---
 drivers/net/wireless/ath/ath10k/sdio.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/sdio.c b/drivers/net/wireless/ath/ath10k/sdio.c
index 08a6f36a6be9..432dee87d73b 100644
--- a/drivers/net/wireless/ath/ath10k/sdio.c
+++ b/drivers/net/wireless/ath/ath10k/sdio.c
@@ -1589,14 +1589,12 @@ static int ath10k_sdio_hif_power_up(struct ath10k *ar,
 	sdio_claim_host(func);

 	ret = sdio_enable_func(func);
+	sdio_release_host(func);
 	if (ret) {
 		ath10k_warn(ar, "unable to enable sdio function: %d)\n", ret);
-		sdio_release_host(func);
 		return ret;
 	}

-	sdio_release_host(func);
-
 	/* Wait for hardware to initialise. It should take a lot less than
 	 * 20 ms but let's be conservative here.
 	 */
@@ -1884,14 +1882,12 @@ static int ath10k_sdio_hif_start(struct ath10k *ar)

 	/* Register the isr */
 	ret =  sdio_claim_irq(ar_sdio->func, ath10k_sdio_irq_handler);
+	sdio_release_host(ar_sdio->func);
 	if (ret) {
 		ath10k_warn(ar, "failed to claim sdio interrupt: %d\n", ret);
-		sdio_release_host(ar_sdio->func);
 		return ret;
 	}

-	sdio_release_host(ar_sdio->func);
-
 	ret = ath10k_sdio_enable_intrs(ar);
 	if (ret)
 		ath10k_warn(ar, "failed to enable sdio interrupts: %d\n", ret);
--
2.46.0


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ