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>] [thread-next>] [day] [month] [year] [list]
Date: Tue, 13 Feb 2024 11:09:06 +0100
From: Arnd Bergmann <arnd@...nel.org>
To: Kalle Valo <kvalo@...nel.org>,
	Jeff Johnson <quic_jjohnson@...cinc.com>,
	Karthikeyan Periyasamy <quic_periyasa@...cinc.com>
Cc: Arnd Bergmann <arnd@...db.de>,
	Aloka Dixit <quic_alokad@...cinc.com>,
	Wen Gong <quic_wgong@...cinc.com>,
	Muna Sinada <quic_msinada@...cinc.com>,
	Aditya Kumar Singh <quic_adisi@...cinc.com>,
	ath12k@...ts.infradead.org,
	linux-wireless@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: [PATCH] wifi: ath12k: sanitize ath12k_mac_allocate() return code

From: Arnd Bergmann <arnd@...db.de>

The return code has no initializer:

drivers/net/wireless/ath/ath12k/mac.c:8006:9: error: variable 'ret' is uninitialized when used here [-Werror,-Wuninitialized]

Make it return -ENOMEM for allocation failures and remove the unused
variable instead.

Fixes: 6db6e70a17f6 ("wifi: ath12k: Introduce the container for mac80211 hw")
Signed-off-by: Arnd Bergmann <arnd@...db.de>
---
 drivers/net/wireless/ath/ath12k/mac.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c
index f2f7b2a60261..e93475ae8d07 100644
--- a/drivers/net/wireless/ath/ath12k/mac.c
+++ b/drivers/net/wireless/ath/ath12k/mac.c
@@ -7965,7 +7965,7 @@ int ath12k_mac_allocate(struct ath12k_base *ab)
 {
 	struct ath12k_hw *ah;
 	struct ath12k_pdev_map pdev_map[MAX_RADIOS];
-	int ret, i, j;
+	int i, j;
 	u8 radio_per_hw;
 
 	if (test_bit(ATH12K_FLAG_REGISTERED, &ab->dev_flags))
@@ -8003,5 +8003,5 @@ int ath12k_mac_allocate(struct ath12k_base *ab)
 		ab->ah[i] = NULL;
 	}
 
-	return ret;
+	return -ENOMEM;
 }
-- 
2.39.2


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ