linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH next] coresight: Fix a NULL vs IS_ERR() bug in probe
@ 2025-07-16 19:38 Dan Carpenter
  2025-07-18 12:47 ` Mike Leach
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Dan Carpenter @ 2025-07-16 19:38 UTC (permalink / raw)
  To: Yuanfang Zhang
  Cc: Suzuki K Poulose, Mike Leach, James Clark, Alexander Shishkin,
	Leo Yan, coresight, linux-arm-kernel, linux-kernel,
	kernel-janitors

The devm_ioremap_resource() function returns error pointers on error.
It never returns NULL.  Update the error checking to match.

Fixes: 26e20622a8ae ("coresight: add coresight Trace Network On Chip driver")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
 drivers/hwtracing/coresight/coresight-tnoc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/hwtracing/coresight/coresight-tnoc.c b/drivers/hwtracing/coresight/coresight-tnoc.c
index 0e4164707eea..d542df46ea39 100644
--- a/drivers/hwtracing/coresight/coresight-tnoc.c
+++ b/drivers/hwtracing/coresight/coresight-tnoc.c
@@ -183,8 +183,8 @@ static int trace_noc_probe(struct amba_device *adev, const struct amba_id *id)
 	dev_set_drvdata(dev, drvdata);
 
 	drvdata->base = devm_ioremap_resource(dev, &adev->res);
-	if (!drvdata->base)
-		return -ENOMEM;
+	if (IS_ERR(drvdata->base))
+		return PTR_ERR(drvdata->base);
 
 	spin_lock_init(&drvdata->spinlock);
 
-- 
2.47.2



^ permalink raw reply related	[flat|nested] 9+ messages in thread
* [PATCH next] Coresight: Fix a NULL vs IS_ERR() bug in probe
@ 2025-03-14 10:55 Dan Carpenter
  2025-03-17  1:07 ` Jie Gan
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Dan Carpenter @ 2025-03-14 10:55 UTC (permalink / raw)
  To: Jie Gan
  Cc: Suzuki K Poulose, Mike Leach, James Clark, Alexander Shishkin,
	coresight, linux-arm-kernel, linux-kernel, kernel-janitors

The devm_platform_get_and_ioremap_resource() function doesn't
return NULL, it returns error pointers.  Update the checking to
match.

Fixes: f78d206f3d73 ("Coresight: Add Coresight TMC Control Unit driver")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
---
 drivers/hwtracing/coresight/coresight-ctcu-core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/hwtracing/coresight/coresight-ctcu-core.c b/drivers/hwtracing/coresight/coresight-ctcu-core.c
index da35d8b4d579..c6bafc96db96 100644
--- a/drivers/hwtracing/coresight/coresight-ctcu-core.c
+++ b/drivers/hwtracing/coresight/coresight-ctcu-core.c
@@ -204,8 +204,8 @@ static int ctcu_probe(struct platform_device *pdev)
 	dev->platform_data = pdata;
 
 	base = devm_platform_get_and_ioremap_resource(pdev, 0, NULL);
-	if (!base)
-		return -ENOMEM;
+	if (IS_ERR(base))
+		return PTR_ERR(base);
 
 	drvdata->apb_clk = coresight_get_enable_apb_pclk(dev);
 	if (IS_ERR(drvdata->apb_clk))
-- 
2.47.2



^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2025-07-24 13:55 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-16 19:38 [PATCH next] coresight: Fix a NULL vs IS_ERR() bug in probe Dan Carpenter
2025-07-18 12:47 ` Mike Leach
2025-07-21 11:16 ` Anshuman Khandual
2025-07-24 13:29   ` Leo Yan
2025-07-21 11:23 ` Suzuki K Poulose
  -- strict thread matches above, loose matches on Subject: below --
2025-03-14 10:55 [PATCH next] Coresight: " Dan Carpenter
2025-03-17  1:07 ` Jie Gan
2025-03-17  2:13 ` Anshuman Khandual
2025-03-17 10:07 ` Suzuki K Poulose

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).