From: Yang Yingliang <yangyingliang@huawei.com>
To: <linux-kernel@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<linuxppc-dev@lists.ozlabs.org>
Cc: <michael@walle.cc>, <arnd@arndb.de>, <shawnguo@kernel.org>
Subject: [PATCH -next 1/2] soc: fsl: guts: fix return value check in fsl_guts_init()
Date: Tue, 28 Jun 2022 22:02:48 +0800 [thread overview]
Message-ID: <20220628140249.1073809-1-yangyingliang@huawei.com> (raw)
In case of error, of_iomap() returns NULL pointer not ERR_PTR().
The IS_ERR() test in the return value check should be replaced
with NULL test and return -ENOMEM as error value.
Fixes: ab4988d6a393 ("soc: fsl: guts: embed fsl_guts_get_svr() in probe()")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Yang Yingliang <yangyingliang@huawei.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.25.1
next reply other threads:[~2022-06-28 13:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-28 14:02 Yang Yingliang [this message]
2022-06-28 14:02 ` [PATCH -next 2/2] soc: fsl: guts: check return value after calling of_iomap() in fsl_guts_get_soc_uid() Yang Yingliang
2022-06-28 14:29 ` Michael Walle
2022-06-28 14:27 ` [PATCH -next 1/2] soc: fsl: guts: fix return value check in fsl_guts_init() Michael Walle
2022-07-05 0:42 ` Shawn Guo
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=20220628140249.1073809-1-yangyingliang@huawei.com \
--to=yangyingliang@huawei.com \
--cc=arnd@arndb.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.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).