]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
coresight: tnoc: Fix a NULL vs IS_ERR() bug in probe
authorDan Carpenter <dan.carpenter@linaro.org>
Wed, 16 Jul 2025 19:38:30 +0000 (14:38 -0500)
committerSuzuki K Poulose <suzuki.poulose@arm.com>
Tue, 23 Sep 2025 13:13:27 +0000 (14:13 +0100)
The devm_ioremap_resource() function returns error pointers on error.
It never returns NULL.  Update the error checking to match.

Fixes: e54a52a28a36 ("coresight: add coresight Trace Network On Chip driver")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Mike Leach <mike.leach@linaro.org>
Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Link: https://lore.kernel.org/r/7bd9fae8-a15f-412a-8800-ce47acf0b5ce@sabinyo.mountain
drivers/hwtracing/coresight/coresight-tnoc.c

index 0e4164707eea974e6f34d2de01693354d6eefdcd..d542df46ea39314605290311f683010337bfd4bd 100644 (file)
@@ -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);