From: Luo Meng <luomeng12@huawei.com>
To: <ssantosh@kernel.org>, <rogerq@ti.com>,
<grzegorz.jaszczyk@linaro.org>, <s-anna@ti.com>,
<linux-arm-kernel@lists.infradead.org>, <luomeng12@huawei.com>
Subject: [PATCH] soc: ti: pruss: fix return check for of_device_get_match_data()
Date: Tue, 10 Nov 2020 09:33:50 +0800 [thread overview]
Message-ID: <20201110013350.2499706-1-luomeng12@huawei.com> (raw)
of_device_get_match_data() maybe return NULL pointer which cannot
be checked with IS_ERR.
Fixes: ba59c9b43c86 ("soc: ti: pruss: support CORECLK_MUX and IEPCLK_MUX")
Reported-by: Hulk Robot <hulkci@huawei.com>
Signed-off-by: Luo Meng <luomeng12@huawei.com>
---
drivers/soc/ti/pruss.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/soc/ti/pruss.c b/drivers/soc/ti/pruss.c
index cc0b4ad7a3d3..582f48051c30 100644
--- a/drivers/soc/ti/pruss.c
+++ b/drivers/soc/ti/pruss.c
@@ -126,7 +126,7 @@ static int pruss_clk_init(struct pruss *pruss, struct device_node *cfg_node)
int ret = 0;
data = of_device_get_match_data(dev);
- if (IS_ERR(data))
+ if (!data)
return -ENODEV;
clks_np = of_get_child_by_name(cfg_node, "clocks");
@@ -175,7 +175,7 @@ static int pruss_probe(struct platform_device *pdev)
const char *mem_names[PRUSS_MEM_MAX] = { "dram0", "dram1", "shrdram2" };
data = of_device_get_match_data(&pdev->dev);
- if (IS_ERR(data)) {
+ if (!data) {
dev_err(dev, "missing private data\n");
return -ENODEV;
}
--
2.25.4
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next reply other threads:[~2020-11-10 1:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-10 1:33 Luo Meng [this message]
2020-11-10 8:28 ` [PATCH] soc: ti: pruss: fix return check for of_device_get_match_data() Grzegorz Jaszczyk
2020-11-10 9:54 ` Lee Jones
2020-11-10 20:41 ` Suman Anna
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=20201110013350.2499706-1-luomeng12@huawei.com \
--to=luomeng12@huawei.com \
--cc=grzegorz.jaszczyk@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=rogerq@ti.com \
--cc=s-anna@ti.com \
--cc=ssantosh@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).