Skip to content

Commit 898d8b3

Browse files
Karthikeyan Periyasamykvalo
authored andcommitted
wifi: ath12k: fix the error handler of rfkill config
When the core rfkill config throws error, it should free the allocated resources. Currently it is not freeing the core pdev create resources. Avoid this issue by calling the core pdev destroy in the error handler of core rfkill config. Found this issue in the code review and it is compile tested only. Fixes: 004ccbc ("wifi: ath12k: add support for hardware rfkill for WCN7850") Signed-off-by: Karthikeyan Periyasamy <[email protected]> Acked-by: Jeff Johnson <[email protected]> Signed-off-by: Kalle Valo <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent c7b4f54 commit 898d8b3

File tree

1 file changed

+4
-2
lines changed
  • drivers/net/wireless/ath/ath12k

1 file changed

+4
-2
lines changed

drivers/net/wireless/ath/ath12k/core.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: BSD-3-Clause-Clear
22
/*
33
* Copyright (c) 2018-2021 The Linux Foundation. All rights reserved.
4-
* Copyright (c) 2021-2022 Qualcomm Innovation Center, Inc. All rights reserved.
4+
* Copyright (c) 2021-2023 Qualcomm Innovation Center, Inc. All rights reserved.
55
*/
66

77
#include <linux/module.h>
@@ -698,13 +698,15 @@ int ath12k_core_qmi_firmware_ready(struct ath12k_base *ab)
698698
ret = ath12k_core_rfkill_config(ab);
699699
if (ret && ret != -EOPNOTSUPP) {
700700
ath12k_err(ab, "failed to config rfkill: %d\n", ret);
701-
goto err_core_stop;
701+
goto err_core_pdev_destroy;
702702
}
703703

704704
mutex_unlock(&ab->core_lock);
705705

706706
return 0;
707707

708+
err_core_pdev_destroy:
709+
ath12k_core_pdev_destroy(ab);
708710
err_core_stop:
709711
ath12k_core_stop(ab);
710712
ath12k_mac_destroy(ab);

0 commit comments

Comments
 (0)