[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a7ca4e4b-c432-4f2b-81c6-c7b06cd12de1@oss.qualcomm.com>
Date: Mon, 10 Feb 2025 17:08:31 -0800
From: Jeff Johnson <jeff.johnson@....qualcomm.com>
To: Ethan Carter Edwards <ethan@...ancedwards.com>,
Kalle Valo <kvalo@...nel.org>,
Karthikeyan Periyasamy <quic_periyasa@...cinc.com>
Cc: Jeff Johnson <jjohnson@...nel.org>,
Harshitha Prem <quic_hprem@...cinc.com>,
Kalle Valo
<quic_kvalo@...cinc.com>, linux-wireless@...r.kernel.org,
ath12k@...ts.infradead.org, linux-kernel@...r.kernel.org,
linux-hardening@...r.kernel.org
Subject: Re: [PATCH] wifi: ath12k: Fix uninitialized variable and remove goto
On 2/9/2025 8:36 PM, Ethan Carter Edwards wrote:
commit subject should be as specific as possible.
suggest you at least mention the function
> There is a possibility for an uninitialized *ret* variable to be
> returned in some code paths.
>
> This moves *ret* inside the conditional and explicitly returns 0 without
> an error. Also removes goto that returned *ret*.
ath driver convention is to declare function variables at the beginning of the
function -- please do not relocate the definition of 'ret'
>
> Addresses-Coverity-ID: 1642337 ("Uninitialized scalar variable")
Is that an official kernel tag? IMO the proper tag would be
Closes: https://scan5.scan.coverity.com/#/project-view/63541/10063?selectedIssue=1642337
(is there a shorter URL?)
see https://www.kernel.org/doc/html/latest/process/submitting-patches.html#using-reported-by-tested-by-reviewed-by-suggested-by-and-fixes
> Fixes: b716a10d99a28 ("wifi: ath12k: enable MLO setup and teardown from core")
> Signed-off-by: Ethan Carter Edwards <ethan@...ancedwards.com>
> ---
> drivers/net/wireless/ath/ath12k/core.c | 8 +++-----
> 1 file changed, 3 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath12k/core.c b/drivers/net/wireless/ath/ath12k/core.c
> index 0606116d6b9c491b6ede401b2e1aedfb619339a8..ae75cdad3bd6b6eb80a35fee94c18d365d123cbd 100644
> --- a/drivers/net/wireless/ath/ath12k/core.c
> +++ b/drivers/net/wireless/ath/ath12k/core.c
> @@ -908,7 +908,6 @@ int ath12k_mac_mlo_ready(struct ath12k_hw_group *ag)
> {
> struct ath12k_hw *ah;
> struct ath12k *ar;
> - int ret;
> int i, j;
>
> for (i = 0; i < ag->num_hw; i++) {
> @@ -918,14 +917,13 @@ int ath12k_mac_mlo_ready(struct ath12k_hw_group *ag)
>
> for_each_ar(ah, ar, j) {
> ar = &ah->radio[j];
> - ret = __ath12k_mac_mlo_ready(ar);
> + int ret = __ath12k_mac_mlo_ready(ar);
> if (ret)
> - goto out;
> + return ret;
> }
> }
>
> -out:
> - return ret;
> + return 0;
> }
>
> static int ath12k_core_mlo_setup(struct ath12k_hw_group *ag)
>
> ---
> base-commit: a64dcfb451e254085a7daee5fe51bf22959d52d3
> change-id: 20250209-ath12k-uninit-18560fd91c07
>
> Best regards,
replacing goto out with return ret and unconditional return 0 LGTM.
can you respin a v2 with the other comments addressed?
/jeff
Powered by blists - more mailing lists