From: Kalle Valo <kvalo@codeaurora.org>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Govind Singh <govinds@codeaurora.org>,
ath10k@lists.infradead.org, linux-wireless@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] ath10k: fix a NULL vs IS_ERR() check
Date: Mon, 26 Nov 2018 10:24:38 +0200 [thread overview]
Message-ID: <8736rob60p.fsf@kamboji.qca.qualcomm.com> (raw)
In-Reply-To: <20181126081143.tvu55aimdc3safcq@kili.mountain> (Dan Carpenter's message of "Mon, 26 Nov 2018 11:11:43 +0300")
Dan Carpenter <dan.carpenter@oracle.com> writes:
> 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>
> ---
> drivers/net/wireless/ath/ath10k/qmi.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/wireless/ath/ath10k/qmi.c b/drivers/net/wireless/ath/ath10k/qmi.c
> index f0429bee35c2..37b3bd629f48 100644
> --- a/drivers/net/wireless/ath/ath10k/qmi.c
> +++ b/drivers/net/wireless/ath/ath10k/qmi.c
> @@ -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);
That's a very good find!
But how has this even worked before? I would assume devm_memremap()
always returns a non-NULL value and ath10k would have interpreted that
as an error?
--
Kalle Valo
next prev parent reply other threads:[~2018-11-26 8:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-11-26 8:11 [PATCH] ath10k: fix a NULL vs IS_ERR() check Dan Carpenter
2018-11-26 8:24 ` Kalle Valo [this message]
2018-11-26 8:30 ` Dan Carpenter
2018-11-26 13:06 ` Kalle Valo
2018-12-20 17:05 ` Kalle Valo
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=8736rob60p.fsf@kamboji.qca.qualcomm.com \
--to=kvalo@codeaurora.org \
--cc=ath10k@lists.infradead.org \
--cc=dan.carpenter@oracle.com \
--cc=govinds@codeaurora.org \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).