From: Arnd Bergmann <arnd@kernel.org>
To: Kalle Valo <kvalo@kernel.org>,
Jeff Johnson <quic_jjohnson@quicinc.com>,
Karthikeyan Periyasamy <quic_periyasa@quicinc.com>
Cc: Arnd Bergmann <arnd@arndb.de>,
Aloka Dixit <quic_alokad@quicinc.com>,
Wen Gong <quic_wgong@quicinc.com>,
Muna Sinada <quic_msinada@quicinc.com>,
Aditya Kumar Singh <quic_adisi@quicinc.com>,
ath12k@lists.infradead.org, linux-wireless@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH] wifi: ath12k: sanitize ath12k_mac_allocate() return code
Date: Tue, 13 Feb 2024 11:09:06 +0100 [thread overview]
Message-ID: <20240213100912.459018-1-arnd@kernel.org> (raw)
From: Arnd Bergmann <arnd@arndb.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@arndb.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
next reply other threads:[~2024-02-13 10:09 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-13 10:09 Arnd Bergmann [this message]
2024-02-14 8:44 ` [PATCH] wifi: ath12k: sanitize ath12k_mac_allocate() return code Kalle Valo
2024-02-14 10:37 ` Arnd Bergmann
2024-02-14 10:44 ` Kalle Valo
2024-02-14 10:51 ` Arnd Bergmann
2024-02-14 12:21 ` Kalle Valo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240213100912.459018-1-arnd@kernel.org \
--to=arnd@kernel.org \
--cc=arnd@arndb.de \
--cc=ath12k@lists.infradead.org \
--cc=kvalo@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=quic_adisi@quicinc.com \
--cc=quic_alokad@quicinc.com \
--cc=quic_jjohnson@quicinc.com \
--cc=quic_msinada@quicinc.com \
--cc=quic_periyasa@quicinc.com \
--cc=quic_wgong@quicinc.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).