From: Dan Carpenter <dan.carpenter@oracle.com>
To: Li Yang <leoyang.li@nxp.com>, Michael Walle <michael@walle.cc>
Cc: linuxppc-dev@lists.ozlabs.org, kernel-janitors@vger.kernel.org,
Shawn Guo <shawnguo@kernel.org>,
linux-arm-kernel@lists.infradead.org,
Arnd Bergmann <arnd@arndb.de>
Subject: [PATCH] soc: fsl: guts: fix IS_ERR() vs NULL bug
Date: Mon, 4 Jul 2022 13:55:04 +0300 [thread overview]
Message-ID: <YsLHCE/ttyl/OeHs@kili> (raw)
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");
--
2.35.1
next reply other threads:[~2022-07-04 10:56 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-04 10:55 Dan Carpenter [this message]
2022-07-04 11:01 ` [PATCH] soc: fsl: guts: fix IS_ERR() vs NULL bug Michael Walle
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=YsLHCE/ttyl/OeHs@kili \
--to=dan.carpenter@oracle.com \
--cc=arnd@arndb.de \
--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=michael@walle.cc \
--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).