]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wifi: ath11k: fix suspend use-after-free after probe failure
authorJohan Hovold <johan+linaro@kernel.org>
Tue, 24 Jun 2025 08:20:22 +0000 (10:20 +0200)
committerJeff Johnson <jeff.johnson@oss.qualcomm.com>
Thu, 26 Jun 2025 23:10:45 +0000 (16:10 -0700)
Make sure to deregister the PM notifier to avoid a use-after-free on
suspend in case core initialisation fails (e.g. due to missing
firmware).

Tested-on: WCN6855 hw2.0 WLAN.HSP.1.1-03125-QCAHSPSWPL_V1_V2_SILICONZ_LITE-3.6510.41

Fixes: 32d93b51bc7e ("wifi: ath11k: choose default PM policy for hibernation")
Reported-by: Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Closes: https://lore.kernel.org/all/d0cd065c-1cd1-4e56-8c57-60777b1f3664@oss.qualcomm.com/
Cc: Baochen Qiang <quic_bqiang@quicinc.com>
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
Link: https://patch.msgid.link/20250624082022.15469-1-johan+linaro@kernel.org
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
drivers/net/wireless/ath/ath11k/core.c

index 48d81b82f8954acb74701ff86aa58c9ff6f20810..ad942fad01e95a49d9e44c293d8bb84cba2f3903 100644 (file)
@@ -2583,10 +2583,15 @@ int ath11k_core_init(struct ath11k_base *ab)
        ret = ath11k_core_soc_create(ab);
        if (ret) {
                ath11k_err(ab, "failed to create soc core: %d\n", ret);
-               return ret;
+               goto err_unregister_pm_notifier;
        }
 
        return 0;
+
+err_unregister_pm_notifier:
+       ath11k_core_pm_notifier_unregister(ab);
+
+       return ret;
 }
 EXPORT_SYMBOL(ath11k_core_init);