Skip to content

Commit 7fdd04e

Browse files
Dan CarpenterSuzuki K Poulose
authored andcommitted
coresight: tnoc: 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: e54a52a ("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
1 parent e54a52a commit 7fdd04e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

drivers/hwtracing/coresight/coresight-tnoc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -183,8 +183,8 @@ static int trace_noc_probe(struct amba_device *adev, const struct amba_id *id)
183183
dev_set_drvdata(dev, drvdata);
184184

185185
drvdata->base = devm_ioremap_resource(dev, &adev->res);
186-
if (!drvdata->base)
187-
return -ENOMEM;
186+
if (IS_ERR(drvdata->base))
187+
return PTR_ERR(drvdata->base);
188188

189189
spin_lock_init(&drvdata->spinlock);
190190

0 commit comments

Comments
 (0)