From: Michael Walle <michael@walle.cc>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Arnd Bergmann <arnd@arndb.de>, Shawn Guo <shawnguo@kernel.org>,
kernel-janitors@vger.kernel.org, Li Yang <leoyang.li@nxp.com>,
linuxppc-dev@lists.ozlabs.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] soc: fsl: guts: fix IS_ERR() vs NULL bug
Date: Mon, 04 Jul 2022 13:01:46 +0200 [thread overview]
Message-ID: <9d3033f1ddaa224a792849fdf952587f@walle.cc> (raw)
In-Reply-To: <YsLHCE/ttyl/OeHs@kili>
Am 2022-07-04 12:55, schrieb Dan Carpenter:
> The of_iomap() function returns NULL on failure, it never returns
> error pointers.
>
> Fixes: ab4988d6a393 ("soc: fsl: guts: embed fsl_guts_get_svr() in
> probe()")
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
> ---
> drivers/soc/fsl/guts.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/soc/fsl/guts.c b/drivers/soc/fsl/guts.c
> index 27035de062f8..8038c599ad83 100644
> --- a/drivers/soc/fsl/guts.c
> +++ b/drivers/soc/fsl/guts.c
> @@ -195,9 +195,9 @@ static int __init fsl_guts_init(void)
> soc_data = match->data;
>
> regs = of_iomap(np, 0);
> - if (IS_ERR(regs)) {
> + if (!regs) {
> of_node_put(np);
> - return PTR_ERR(regs);
> + return -ENOMEM;
> }
>
> little_endian = of_property_read_bool(np, "little-endian");
There was already a patch for this:
https://lore.kernel.org/lkml/20220628140249.1073809-1-yangyingliang@huawei.com/
-michael
prev parent reply other threads:[~2022-07-04 11:02 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-04 10:55 [PATCH] soc: fsl: guts: fix IS_ERR() vs NULL bug Dan Carpenter
2022-07-04 11:01 ` Michael Walle [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=9d3033f1ddaa224a792849fdf952587f@walle.cc \
--to=michael@walle.cc \
--cc=arnd@arndb.de \
--cc=dan.carpenter@oracle.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=leoyang.li@nxp.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=shawnguo@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).