]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
wifi: ath11k: unmap the CE in ath11k_ahb_probe() error path
authorJeff Johnson <quic_jjohnson@quicinc.com>
Fri, 3 May 2024 10:34:38 +0000 (13:34 +0300)
committerKalle Valo <quic_kvalo@quicinc.com>
Fri, 3 May 2024 13:15:16 +0000 (16:15 +0300)
Currently, in ath11k_ahb_probe(), if a failure occurs after
ath11k_ahb_ce_remap() is called, and if hw_params->ce_remap is
enabled, the CE register memory is not unmapped. So add a call to
ath11k_ahb_ce_unmap() in the error path.

This issue was identified by smatch/smatch_scripts/kchecker:

drivers/net/wireless/ath/ath11k/ahb.c:1218 ath11k_ahb_probe() warn: 'ab->mem_ce' from ioremap() not released on lines: 1218.

Since this is a rare error path with no simple way to test, and since
the change is trivial to review, compile tested only.

Signed-off-by: Jeff Johnson <quic_jjohnson@quicinc.com>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://msgid.link/20240430-ce-unmap-v1-2-e468328f95d9@quicinc.com
drivers/net/wireless/ath/ath11k/ahb.c

index 88dfef71c2b598b11790d4c8a12cc5a67a9577c8..e3ff4786c714de41c5514576eff189902b4f680d 100644 (file)
@@ -1182,7 +1182,7 @@ static int ath11k_ahb_probe(struct platform_device *pdev)
 
        ret = ath11k_ahb_fw_resources_init(ab);
        if (ret)
-               goto err_core_free;
+               goto err_ce_unmap;
 
        ret = ath11k_ahb_setup_smp2p_handle(ab);
        if (ret)
@@ -1234,6 +1234,9 @@ err_release_smp2p_handle:
 err_fw_deinit:
        ath11k_ahb_fw_resource_deinit(ab);
 
+err_ce_unmap:
+       ath11k_ahb_ce_unmap(ab);
+
 err_core_free:
        ath11k_core_free(ab);
        platform_set_drvdata(pdev, NULL);