All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] wifi: ath12k: Fix uninitialized use of ret in ath12k_mac_allocate()
@ 2024-02-05 19:49 Nathan Chancellor
  2024-02-05 20:50 ` Jeff Johnson
  2024-02-07 15:08 ` Kalle Valo
  0 siblings, 2 replies; 5+ messages in thread
From: Nathan Chancellor @ 2024-02-05 19:49 UTC (permalink / raw)
  To: kvalo, quic_jjohnson
  Cc: morbo, justinstitt, quic_periyasa, ath12k, linux-wireless, llvm,
	patches, Nathan Chancellor

Clang warns (or errors with CONFIG_WERROR=y):

  drivers/net/wireless/ath/ath12k/mac.c:8060:9: error: variable 'ret' is uninitialized when used here [-Werror,-Wuninitialized]
   8060 |         return ret;
        |                ^~~
  drivers/net/wireless/ath/ath12k/mac.c:8022:9: note: initialize the variable 'ret' to silence this warning
   8022 |         int ret, i, j;
        |                ^
        |                 = 0
  1 error generated.

Commit 6db6e70a17f6 ("wifi: ath12k: Introduce the container for mac80211
hw") added a completely uninitialized use of ret. Prior to that change,
-ENOMEM was returned to the callers of ath12k_mac_allocate() whenever
ath12k_mac_hw_allocate() failed. Assign that value to ret to make sure
it is always initialized when used and clear up the warning.

Closes: https://github.com/ClangBuiltLinux/linux/issues/1989i
Fixes: 6db6e70a17f6 ("wifi: ath12k: Introduce the container for mac80211 hw")
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
---
 drivers/net/wireless/ath/ath12k/mac.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c
index fb5bf500ed87..4b0521e8fb26 100644
--- a/drivers/net/wireless/ath/ath12k/mac.c
+++ b/drivers/net/wireless/ath/ath12k/mac.c
@@ -8038,6 +8038,7 @@ int ath12k_mac_allocate(struct ath12k_base *ab)
 		if (!ah) {
 			ath12k_warn(ab, "failed to allocate mac80211 hw device for hw_idx %d\n",
 				    i);
+			ret = -ENOMEM;
 			goto err;
 		}
 

---
base-commit: b82fb7ef690bd929b88d9aab1d191ff502ed9029
change-id: 20240205-ath12k-mac-wuninitialized-1bc5faf17d29

Best regards,
-- 
Nathan Chancellor <nathan@kernel.org>


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] wifi: ath12k: Fix uninitialized use of ret in ath12k_mac_allocate()
  2024-02-05 19:49 [PATCH] wifi: ath12k: Fix uninitialized use of ret in ath12k_mac_allocate() Nathan Chancellor
@ 2024-02-05 20:50 ` Jeff Johnson
  2024-02-07 15:08 ` Kalle Valo
  1 sibling, 0 replies; 5+ messages in thread
From: Jeff Johnson @ 2024-02-05 20:50 UTC (permalink / raw)
  To: Nathan Chancellor, kvalo
  Cc: morbo, justinstitt, quic_periyasa, ath12k, linux-wireless, llvm, patches

On 2/5/2024 11:49 AM, Nathan Chancellor wrote:
> Clang warns (or errors with CONFIG_WERROR=y):
> 
>   drivers/net/wireless/ath/ath12k/mac.c:8060:9: error: variable 'ret' is uninitialized when used here [-Werror,-Wuninitialized]
>    8060 |         return ret;
>         |                ^~~
>   drivers/net/wireless/ath/ath12k/mac.c:8022:9: note: initialize the variable 'ret' to silence this warning
>    8022 |         int ret, i, j;
>         |                ^
>         |                 = 0
>   1 error generated.
> 
> Commit 6db6e70a17f6 ("wifi: ath12k: Introduce the container for mac80211
> hw") added a completely uninitialized use of ret. Prior to that change,
> -ENOMEM was returned to the callers of ath12k_mac_allocate() whenever
> ath12k_mac_hw_allocate() failed. Assign that value to ret to make sure
> it is always initialized when used and clear up the warning.
> 
> Closes: https://github.com/ClangBuiltLinux/linux/issues/1989i
> Fixes: 6db6e70a17f6 ("wifi: ath12k: Introduce the container for mac80211 hw")
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] wifi: ath12k: Fix uninitialized use of ret in ath12k_mac_allocate()
  2024-02-05 19:49 [PATCH] wifi: ath12k: Fix uninitialized use of ret in ath12k_mac_allocate() Nathan Chancellor
  2024-02-05 20:50 ` Jeff Johnson
@ 2024-02-07 15:08 ` Kalle Valo
  2024-02-21 18:00   ` Nathan Chancellor
  1 sibling, 1 reply; 5+ messages in thread
From: Kalle Valo @ 2024-02-07 15:08 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: quic_jjohnson, morbo, justinstitt, quic_periyasa, ath12k,
	linux-wireless, llvm, patches, Nathan Chancellor

Nathan Chancellor <nathan@kernel.org> wrote:

> Clang warns (or errors with CONFIG_WERROR=y):
> 
>   drivers/net/wireless/ath/ath12k/mac.c:8060:9: error: variable 'ret' is uninitialized when used here [-Werror,-Wuninitialized]
>    8060 |         return ret;
>         |                ^~~
>   drivers/net/wireless/ath/ath12k/mac.c:8022:9: note: initialize the variable 'ret' to silence this warning
>    8022 |         int ret, i, j;
>         |                ^
>         |                 = 0
>   1 error generated.
> 
> Commit 6db6e70a17f6 ("wifi: ath12k: Introduce the container for mac80211
> hw") added a completely uninitialized use of ret. Prior to that change,
> -ENOMEM was returned to the callers of ath12k_mac_allocate() whenever
> ath12k_mac_hw_allocate() failed. Assign that value to ret to make sure
> it is always initialized when used and clear up the warning.
> 
> Closes: https://github.com/ClangBuiltLinux/linux/issues/1989i
> Fixes: 6db6e70a17f6 ("wifi: ath12k: Introduce the container for mac80211 hw")
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>
> Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>

Patch applied to ath-next branch of ath.git, thanks.

04edb5dc68f4 wifi: ath12k: Fix uninitialized use of ret in ath12k_mac_allocate()

-- 
https://patchwork.kernel.org/project/linux-wireless/patch/20240205-ath12k-mac-wuninitialized-v1-1-3fda7b17357f@kernel.org/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] wifi: ath12k: Fix uninitialized use of ret in ath12k_mac_allocate()
  2024-02-07 15:08 ` Kalle Valo
@ 2024-02-21 18:00   ` Nathan Chancellor
  2024-02-21 18:21     ` Kalle Valo
  0 siblings, 1 reply; 5+ messages in thread
From: Nathan Chancellor @ 2024-02-21 18:00 UTC (permalink / raw)
  To: Kalle Valo
  Cc: quic_jjohnson, morbo, justinstitt, quic_periyasa, ath12k,
	linux-wireless, llvm, patches

Hi Kalle,

On Wed, Feb 07, 2024 at 03:08:14PM +0000, Kalle Valo wrote:
> Nathan Chancellor <nathan@kernel.org> wrote:
> 
> > Clang warns (or errors with CONFIG_WERROR=y):
> > 
> >   drivers/net/wireless/ath/ath12k/mac.c:8060:9: error: variable 'ret' is uninitialized when used here [-Werror,-Wuninitialized]
> >    8060 |         return ret;
> >         |                ^~~
> >   drivers/net/wireless/ath/ath12k/mac.c:8022:9: note: initialize the variable 'ret' to silence this warning
> >    8022 |         int ret, i, j;
> >         |                ^
> >         |                 = 0
> >   1 error generated.
> > 
> > Commit 6db6e70a17f6 ("wifi: ath12k: Introduce the container for mac80211
> > hw") added a completely uninitialized use of ret. Prior to that change,
> > -ENOMEM was returned to the callers of ath12k_mac_allocate() whenever
> > ath12k_mac_hw_allocate() failed. Assign that value to ret to make sure
> > it is always initialized when used and clear up the warning.
> > 
> > Closes: https://github.com/ClangBuiltLinux/linux/issues/1989i
> > Fixes: 6db6e70a17f6 ("wifi: ath12k: Introduce the container for mac80211 hw")
> > Signed-off-by: Nathan Chancellor <nathan@kernel.org>
> > Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
> > Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
> 
> Patch applied to ath-next branch of ath.git, thanks.
> 
> 04edb5dc68f4 wifi: ath12k: Fix uninitialized use of ret in ath12k_mac_allocate()

It doesn't seem like this tree or branch flows into -next on its own, so
this patch is not present in and the build still breaks on
next-20240221. Can this be fixed so that this warning stops breaking our
builds?

Cheers,
Nathan

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] wifi: ath12k: Fix uninitialized use of ret in ath12k_mac_allocate()
  2024-02-21 18:00   ` Nathan Chancellor
@ 2024-02-21 18:21     ` Kalle Valo
  0 siblings, 0 replies; 5+ messages in thread
From: Kalle Valo @ 2024-02-21 18:21 UTC (permalink / raw)
  To: Nathan Chancellor
  Cc: quic_jjohnson, morbo, justinstitt, quic_periyasa, ath12k,
	linux-wireless, llvm, patches

Nathan Chancellor <nathan@kernel.org> writes:

> Hi Kalle,
>
> On Wed, Feb 07, 2024 at 03:08:14PM +0000, Kalle Valo wrote:
>> Nathan Chancellor <nathan@kernel.org> wrote:
>> 
>> > Clang warns (or errors with CONFIG_WERROR=y):
>> > 
>> >   drivers/net/wireless/ath/ath12k/mac.c:8060:9: error: variable 'ret' is uninitialized when used here [-Werror,-Wuninitialized]
>> >    8060 |         return ret;
>> >         |                ^~~
>> >   drivers/net/wireless/ath/ath12k/mac.c:8022:9: note: initialize
>> > the variable 'ret' to silence this warning
>> >    8022 |         int ret, i, j;
>> >         |                ^
>> >         |                 = 0
>> >   1 error generated.
>> > 
>> > Commit 6db6e70a17f6 ("wifi: ath12k: Introduce the container for mac80211
>> > hw") added a completely uninitialized use of ret. Prior to that change,
>> > -ENOMEM was returned to the callers of ath12k_mac_allocate() whenever
>> > ath12k_mac_hw_allocate() failed. Assign that value to ret to make sure
>> > it is always initialized when used and clear up the warning.
>> > 
>> > Closes: https://github.com/ClangBuiltLinux/linux/issues/1989i
>> > Fixes: 6db6e70a17f6 ("wifi: ath12k: Introduce the container for mac80211 hw")
>> > Signed-off-by: Nathan Chancellor <nathan@kernel.org>
>> > Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
>> > Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
>> 
>> Patch applied to ath-next branch of ath.git, thanks.
>> 
>> 04edb5dc68f4 wifi: ath12k: Fix uninitialized use of ret in ath12k_mac_allocate()
>
> It doesn't seem like this tree or branch flows into -next on its own, so
> this patch is not present in and the build still breaks on
> next-20240221. Can this be fixed so that this warning stops breaking our
> builds?

Yeah, ath-next is not pulled to linux-next because of "reasons". We are
planning to send ath-next pull request to wireless-next in the next few
days.

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-02-21 18:21 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-05 19:49 [PATCH] wifi: ath12k: Fix uninitialized use of ret in ath12k_mac_allocate() Nathan Chancellor
2024-02-05 20:50 ` Jeff Johnson
2024-02-07 15:08 ` Kalle Valo
2024-02-21 18:00   ` Nathan Chancellor
2024-02-21 18:21     ` Kalle Valo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.