* [PATCH v2] wifi: ath11k: clean-up during wrong ath11k_crypto_mode
@ 2025-05-15 22:22 Rodrigo Gobbi
2025-05-16 1:51 ` Baochen Qiang
2025-05-16 3:51 ` Vasanthakumar Thiagarajan
0 siblings, 2 replies; 3+ messages in thread
From: Rodrigo Gobbi @ 2025-05-15 22:22 UTC (permalink / raw)
To: jjohnson; +Cc: ~lkcamp/patches, linux-wireless, ath11k, linux-kernel
if ath11k_crypto_mode is invalid (not ATH11K_CRYPT_MODE_SW/ATH11K_CRYPT_MODE_HW),
ath11k_core_qmi_firmware_ready() will not undo some actions that was previously
started/configured. It's reasonable to undo things during this condition, fixing
the following smatch warning:
drivers/net/wireless/ath/ath11k/core.c:2166 ath11k_core_qmi_firmware_ready()
warn: missing unwind goto?
Signed-off-by: Rodrigo Gobbi <rodrigo.gobbi.7@gmail.com>
---
Changelog:
v2: add smatch warn at commit msg
v1: https://lore.kernel.org/linux-wireless/20250515004258.87234-1-rodrigo.gobbi.7@gmail.com/
---
drivers/net/wireless/ath/ath11k/core.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/net/wireless/ath/ath11k/core.c b/drivers/net/wireless/ath/ath11k/core.c
index 2e9f8a5e61e4..fd3017c444a4 100644
--- a/drivers/net/wireless/ath/ath11k/core.c
+++ b/drivers/net/wireless/ath/ath11k/core.c
@@ -2163,7 +2163,9 @@ int ath11k_core_qmi_firmware_ready(struct ath11k_base *ab)
break;
default:
ath11k_info(ab, "invalid crypto_mode: %d\n", ath11k_crypto_mode);
- return -EINVAL;
+ ret = -EINVAL;
+ ath11k_dp_free(ab);
+ goto err_firmware_stop;
}
if (ath11k_frame_mode == ATH11K_HW_TXRX_RAW)
--
2.49.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] wifi: ath11k: clean-up during wrong ath11k_crypto_mode
2025-05-15 22:22 [PATCH v2] wifi: ath11k: clean-up during wrong ath11k_crypto_mode Rodrigo Gobbi
@ 2025-05-16 1:51 ` Baochen Qiang
2025-05-16 3:51 ` Vasanthakumar Thiagarajan
1 sibling, 0 replies; 3+ messages in thread
From: Baochen Qiang @ 2025-05-16 1:51 UTC (permalink / raw)
To: Rodrigo Gobbi, jjohnson
Cc: ~lkcamp/patches, linux-wireless, ath11k, linux-kernel
On 5/16/2025 6:22 AM, Rodrigo Gobbi wrote:
> if ath11k_crypto_mode is invalid (not ATH11K_CRYPT_MODE_SW/ATH11K_CRYPT_MODE_HW),
> ath11k_core_qmi_firmware_ready() will not undo some actions that was previously
> started/configured. It's reasonable to undo things during this condition, fixing
> the following smatch warning:
>
> drivers/net/wireless/ath/ath11k/core.c:2166 ath11k_core_qmi_firmware_ready()
> warn: missing unwind goto?
>
> Signed-off-by: Rodrigo Gobbi <rodrigo.gobbi.7@gmail.com>
> ---
> Changelog:
> v2: add smatch warn at commit msg
> v1: https://lore.kernel.org/linux-wireless/20250515004258.87234-1-rodrigo.gobbi.7@gmail.com/
> ---
> drivers/net/wireless/ath/ath11k/core.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/wireless/ath/ath11k/core.c b/drivers/net/wireless/ath/ath11k/core.c
> index 2e9f8a5e61e4..fd3017c444a4 100644
> --- a/drivers/net/wireless/ath/ath11k/core.c
> +++ b/drivers/net/wireless/ath/ath11k/core.c
> @@ -2163,7 +2163,9 @@ int ath11k_core_qmi_firmware_ready(struct ath11k_base *ab)
> break;
> default:
> ath11k_info(ab, "invalid crypto_mode: %d\n", ath11k_crypto_mode);
> - return -EINVAL;
> + ret = -EINVAL;
> + ath11k_dp_free(ab);
> + goto err_firmware_stop;
> }
Instead, how about moving the ath11k_crypto_mode validating to the top of
ath11k_core_qmi_firmware_ready()?
>
> if (ath11k_frame_mode == ATH11K_HW_TXRX_RAW)
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] wifi: ath11k: clean-up during wrong ath11k_crypto_mode
2025-05-15 22:22 [PATCH v2] wifi: ath11k: clean-up during wrong ath11k_crypto_mode Rodrigo Gobbi
2025-05-16 1:51 ` Baochen Qiang
@ 2025-05-16 3:51 ` Vasanthakumar Thiagarajan
1 sibling, 0 replies; 3+ messages in thread
From: Vasanthakumar Thiagarajan @ 2025-05-16 3:51 UTC (permalink / raw)
To: Rodrigo Gobbi, jjohnson
Cc: ~lkcamp/patches, linux-wireless, ath11k, linux-kernel
On 5/16/2025 3:52 AM, Rodrigo Gobbi wrote:
> if ath11k_crypto_mode is invalid (not ATH11K_CRYPT_MODE_SW/ATH11K_CRYPT_MODE_HW),
> ath11k_core_qmi_firmware_ready() will not undo some actions that was previously
> started/configured. It's reasonable to undo things during this condition, fixing
> the following smatch warning:
>
> drivers/net/wireless/ath/ath11k/core.c:2166 ath11k_core_qmi_firmware_ready()
> warn: missing unwind goto?
>
> Signed-off-by: Rodrigo Gobbi <rodrigo.gobbi.7@gmail.com>
> ---
> Changelog:
> v2: add smatch warn at commit msg
> v1: https://lore.kernel.org/linux-wireless/20250515004258.87234-1-rodrigo.gobbi.7@gmail.com/
> ---
> drivers/net/wireless/ath/ath11k/core.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
Forgot to mention, pls use branch tag (ath-next) in the patch title for automation to
pickup this patch.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2025-05-16 3:52 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-15 22:22 [PATCH v2] wifi: ath11k: clean-up during wrong ath11k_crypto_mode Rodrigo Gobbi
2025-05-16 1:51 ` Baochen Qiang
2025-05-16 3:51 ` Vasanthakumar Thiagarajan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox