From: Michal Wilczynski <m.wilczynski@samsung.com>
To: Dan Carpenter <dan.carpenter@linaro.org>
Cc: Drew Fustini <drew@pdp7.com>, Guo Ren <guoren@kernel.org>,
Fu Wei <wefu@redhat.com>, Jassi Brar <jassisinghbrar@gmail.com>,
linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org,
kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] mailbox: th1520: Fix a NULL vs IS_ERR() bug
Date: Mon, 2 Dec 2024 10:31:18 +0100 [thread overview]
Message-ID: <90d4515c-835f-4aaa-8c9f-263f23bdfdb2@samsung.com> (raw)
In-Reply-To: <bda05d7b-5a6e-4f57-a124-ba56f51da031@stanley.mountain>
On 11/30/24 11:07, Dan Carpenter wrote:
> The devm_ioremap() function doesn't return error pointers, it returns
> NULL. Update the error checking to match.
>
> Fixes: 5d4d263e1c6b ("mailbox: Introduce support for T-head TH1520 Mailbox driver")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
> drivers/mailbox/mailbox-th1520.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/mailbox/mailbox-th1520.c b/drivers/mailbox/mailbox-th1520.c
> index 4e84640ac3b8..e16e7c85ee3c 100644
> --- a/drivers/mailbox/mailbox-th1520.c
> +++ b/drivers/mailbox/mailbox-th1520.c
> @@ -387,8 +387,10 @@ static void __iomem *th1520_map_mmio(struct platform_device *pdev,
>
> mapped = devm_ioremap(&pdev->dev, res->start + offset,
> resource_size(res) - offset);
> - if (IS_ERR(mapped))
> + if (!mapped) {
> dev_err(&pdev->dev, "Failed to map resource: %s\n", res_name);
> + return ERR_PTR(-ENOMEM);
> + }
>
> return mapped;
> }
Looks good, thanks !
Reviewed-by: Michal Wilczynski <m.wilczynski@samsung.com>
prev parent reply other threads:[~2024-12-02 9:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20241130100751eucas1p25283ed89679b086be2863092149236b8@eucas1p2.samsung.com>
2024-11-30 10:07 ` Dan Carpenter
2024-11-30 12:34 ` Markus Elfring
2024-12-02 9:31 ` Michal Wilczynski [this message]
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=90d4515c-835f-4aaa-8c9f-263f23bdfdb2@samsung.com \
--to=m.wilczynski@samsung.com \
--cc=dan.carpenter@linaro.org \
--cc=drew@pdp7.com \
--cc=guoren@kernel.org \
--cc=jassisinghbrar@gmail.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=wefu@redhat.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®