[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <7bd9fae8-a15f-412a-8800-ce47acf0b5ce@sabinyo.mountain>
Date: Wed, 16 Jul 2025 14:38:30 -0500
From: Dan Carpenter <dan.carpenter@...aro.org>
To: Yuanfang Zhang <quic_yuanfang@...cinc.com>
Cc: Suzuki K Poulose <suzuki.poulose@....com>,
Mike Leach <mike.leach@...aro.org>,
James Clark <james.clark@...aro.org>,
Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
Leo Yan <leo.yan@....com>, coresight@...ts.linaro.org,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
kernel-janitors@...r.kernel.org
Subject: [PATCH next] coresight: Fix a NULL vs IS_ERR() bug in probe
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@...aro.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
Powered by blists - more mailing lists