59132913bd0f9f2ece1d24e2f04c7afe5c4a16bc
[librecmc/librecmc.git] /
1 From 342fcde9d91460f01f65707e16368a1571271a3a Mon Sep 17 00:00:00 2001
2 From: Yang Yingliang <yangyingliang@huawei.com>
3 Date: Fri, 17 Feb 2023 11:00:31 +0800
4 Subject: [PATCH] wifi: ath11k: fix return value check in ath11k_ahb_probe()
5
6 ioremap() returns NULL pointer not PTR_ERR() when it fails,
7 so replace the IS_ERR() check with NULL pointer check.
8
9 Fixes: b42b3678c91f ("wifi: ath11k: remap ce register space for IPQ5018")
10 Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
11 Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
12 Link: https://lore.kernel.org/r/20230217030031.4021289-1-yangyingliang@huawei.com
13 ---
14  drivers/net/wireless/ath/ath11k/ahb.c | 2 +-
15  1 file changed, 1 insertion(+), 1 deletion(-)
16
17 --- a/drivers/net/wireless/ath/ath11k/ahb.c
18 +++ b/drivers/net/wireless/ath/ath11k/ahb.c
19 @@ -1174,7 +1174,7 @@ static int ath11k_ahb_probe(struct platf
20                  * to a new space for accessing them.
21                  */
22                 ab->mem_ce = ioremap(ce_remap->base, ce_remap->size);
23 -               if (IS_ERR(ab->mem_ce)) {
24 +               if (!ab->mem_ce) {
25                         dev_err(&pdev->dev, "ce ioremap error\n");
26                         ret = -ENOMEM;
27                         goto err_core_free;