From: Vasanthakumar Thiagarajan <quic_vthiagar@quicinc.com>
To: Dan Carpenter <dan.carpenter@linaro.org>,
Sowmiya Sree Elavalagan <quic_ssreeela@quicinc.com>
Cc: Jeff Johnson <jjohnson@kernel.org>,
Raj Kumar Bhagat <quic_rajkbhag@quicinc.com>,
Vasanthakumar Thiagarajan
<vasanthakumar.thiagarajan@oss.qualcomm.com>,
Balamurugan S <quic_bselvara@quicinc.com>,
P Praneesh <quic_ppranees@quicinc.com>,
<linux-wireless@vger.kernel.org>, <ath12k@lists.infradead.org>,
<linux-kernel@vger.kernel.org>, <kernel-janitors@vger.kernel.org>
Subject: Re: [PATCH next] wifi: ath12k: Fix a couple NULL vs IS_ERR() bugs
Date: Thu, 10 Apr 2025 22:36:21 +0530 [thread overview]
Message-ID: <88ee501b-7c1b-c8d1-9c7d-ad11c87e7530@quicinc.com> (raw)
In-Reply-To: <937abc74-9648-4c05-a2c3-8db408b3ed9e@stanley.mountain>
On 4/10/2025 9:56 PM, Dan Carpenter wrote:
> The devm_memremap() function returns error pointers on error and the
> ioremap() function returns NULL on error. The error checking here got
> those flipped around.
>
> Fixes: c01d5cc9b9fe ("wifi: ath12k: Power up userPD")
> Fixes: 6cee30f0da75 ("wifi: ath12k: add AHB driver support for IPQ5332")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
> drivers/net/wireless/ath/ath12k/ahb.c | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath12k/ahb.c b/drivers/net/wireless/ath/ath12k/ahb.c
> index a9d9943a73f4..636dfe237a79 100644
> --- a/drivers/net/wireless/ath/ath12k/ahb.c
> +++ b/drivers/net/wireless/ath/ath12k/ahb.c
> @@ -360,10 +360,10 @@ static int ath12k_ahb_power_up(struct ath12k_base *ab)
> mem_phys = rmem->base;
> mem_size = rmem->size;
> mem_region = devm_memremap(dev, mem_phys, mem_size, MEMREMAP_WC);
> - if (!mem_region) {
> + if (IS_ERR(mem_region)) {
> ath12k_err(ab, "unable to map memory region: %pa+%pa\n",
> &rmem->base, &rmem->size);
> - return -ENOMEM;
> + return PTR_ERR(mem_region);
> }
>
> snprintf(fw_name, sizeof(fw_name), "%s/%s/%s%d%s", ATH12K_FW_DIR,
> @@ -929,7 +929,7 @@ static int ath12k_ahb_resource_init(struct ath12k_base *ab)
> * for accessing them.
> */
> ab->mem_ce = ioremap(ce_remap->base, ce_remap->size);
> - if (IS_ERR(ab->mem_ce)) {
> + if (!ab->mem_ce) {
> dev_err(&pdev->dev, "ce ioremap error\n");
> ret = -ENOMEM;
> goto err_mem_unmap;
Thanks for fixing it.
Reviewed-by: Vasanthakumar Thiagarajan <vasanthakumar.thiagarajan@oss.qualcomm.com>
next prev parent reply other threads:[~2025-04-10 17:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-10 16:26 Dan Carpenter
2025-04-10 17:06 ` Vasanthakumar Thiagarajan [this message]
2025-04-12 4:24 ` Jeff Johnson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=88ee501b-7c1b-c8d1-9c7d-ad11c87e7530@quicinc.com \
--to=quic_vthiagar@quicinc.com \
--cc=ath12k@lists.infradead.org \
--cc=dan.carpenter@linaro.org \
--cc=jjohnson@kernel.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=quic_bselvara@quicinc.com \
--cc=quic_ppranees@quicinc.com \
--cc=quic_rajkbhag@quicinc.com \
--cc=quic_ssreeela@quicinc.com \
--cc=vasanthakumar.thiagarajan@oss.qualcomm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®