From: Michal Simek <michal.simek@amd.com>
To: Dan Carpenter <dan.carpenter@linaro.org>, Rob Herring <robh@kernel.org>
Cc: "Arnd Bergmann" <arnd@arndb.de>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
"Benjamin Tissoires" <benjamin.tissoires@redhat.com>,
"Ivan Orlov" <ivan.orlov0322@gmail.com>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] char: xilinx_hwicap: Fix NULL vs IS_ERR() bug
Date: Tue, 20 Feb 2024 10:59:00 +0100 [thread overview]
Message-ID: <cc7f775b-188e-42f8-87dc-00fef1042d9b@amd.com> (raw)
In-Reply-To: <ef647a9c-b1b7-4338-9bc0-28165ec2a367@moroto.mountain>
On 2/20/24 10:02, Dan Carpenter wrote:
> The devm_platform_ioremap_resource() function returns error pointers.
> It never returns NULL. Update the check accordingly.
>
> Fixes: 672371832193 ("char: xilinx_hwicap: Modernize driver probe")
> Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> ---
> drivers/char/xilinx_hwicap/xilinx_hwicap.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/char/xilinx_hwicap/xilinx_hwicap.c b/drivers/char/xilinx_hwicap/xilinx_hwicap.c
> index 019cf6079cec..6d2eadefd9dc 100644
> --- a/drivers/char/xilinx_hwicap/xilinx_hwicap.c
> +++ b/drivers/char/xilinx_hwicap/xilinx_hwicap.c
> @@ -639,8 +639,8 @@ static int hwicap_setup(struct platform_device *pdev, int id,
> dev_set_drvdata(dev, (void *)drvdata);
>
> drvdata->base_address = devm_platform_ioremap_resource(pdev, 0);
> - if (!drvdata->base_address) {
> - retval = -ENODEV;
> + if (IS_ERR(drvdata->base_address)) {
> + retval = PTR_ERR(drvdata->base_address);
> goto failed;
> }
>
Acked-by: Michal Simek <michal.simek@amd.com>
Thanks,
Michal
prev parent reply other threads:[~2024-02-20 9:59 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-20 9:02 Dan Carpenter
2024-02-20 9:59 ` Michal Simek [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=cc7f775b-188e-42f8-87dc-00fef1042d9b@amd.com \
--to=michal.simek@amd.com \
--cc=arnd@arndb.de \
--cc=benjamin.tissoires@redhat.com \
--cc=dan.carpenter@linaro.org \
--cc=gregkh@linuxfoundation.org \
--cc=ivan.orlov0322@gmail.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robh@kernel.org \
--cc=u.kleine-koenig@pengutronix.de \
/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®