ath10k: fix a NULL vs IS_ERR() check
authorDan Carpenter <dan.carpenter@oracle.com>
Thu, 20 Dec 2018 07:53:41 +0000 (09:53 +0200)
committerKalle Valo <kvalo@codeaurora.org>
Thu, 20 Dec 2018 17:05:19 +0000 (19:05 +0200)
The devm_memremap() function doesn't return NULLs, it returns error
pointers.

Fixes: ba94c753ccb4 ("ath10k: add QMI message handshake for wcn3990 client")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
drivers/net/wireless/ath/ath10k/qmi.c

index f0429bee35c288e085c8b3fa9e174ce5a3ee158b..37b3bd629f4870d3607d55754060359c3e0c803a 100644 (file)
@@ -931,9 +931,9 @@ static int ath10k_qmi_setup_msa_resources(struct ath10k_qmi *qmi, u32 msa_size)
                qmi->msa_mem_size = resource_size(&r);
                qmi->msa_va = devm_memremap(dev, qmi->msa_pa, qmi->msa_mem_size,
                                            MEMREMAP_WT);
-               if (!qmi->msa_va) {
+               if (IS_ERR(qmi->msa_va)) {
                        dev_err(dev, "failed to map memory region: %pa\n", &r.start);
-                       return -EBUSY;
+                       return PTR_ERR(qmi->msa_va);
                }
        } else {
                qmi->msa_va = dmam_alloc_coherent(dev, msa_size,