diff mbox series

wifi: ath11k: clean-up during wrong ath11k_crypto_mode

Message ID 20250515004258.87234-1-rodrigo.gobbi.7@gmail.com
State New
Headers show
Series wifi: ath11k: clean-up during wrong ath11k_crypto_mode | expand

Commit Message

Rodrigo Gobbi May 15, 2025, 12:40 a.m. UTC
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, despite
the value used at ath11k_crypto_mode not being valid in this case.

Signed-off-by: Rodrigo Gobbi <rodrigo.gobbi.7@gmail.com>
---
Smatch got the following error:

drivers/net/wireless/ath/ath11k/core.c:2166 ath11k_core_qmi_firmware_ready() warn: missing unwind goto?

When the ath11k_crypto_mode, which is a module param, is not
ATH11K_CRYPT_MODE_SW/HW, clean-up actions are not triggered. 
Considering the whole ath11k_core_qmi_firmware_ready() function,
during potential errors, those actions are properly triggered. 
I'm suggesting a little change over the default case to clean things up.
Tks and regards.
---
 drivers/net/wireless/ath/ath11k/core.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
diff mbox series

Patch

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)