Skip to content

Commit 5442d22

Browse files
Dan CarpenterSuzuki K Poulose
authored andcommitted
Coresight: Fix a NULL vs IS_ERR() bug in probe
The devm_platform_get_and_ioremap_resource() function doesn't return NULL, it returns error pointers. Update the checking to match. Fixes: f78d206 ("Coresight: Add Coresight TMC Control Unit driver") Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Suzuki K Poulose <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent b5060c1 commit 5442d22

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/hwtracing/coresight/coresight-ctcu-core.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,8 +204,8 @@ static int ctcu_probe(struct platform_device *pdev)
204204
dev->platform_data = pdata;
205205

206206
base = devm_platform_get_and_ioremap_resource(pdev, 0, NULL);
207-
if (!base)
208-
return -ENOMEM;
207+
if (IS_ERR(base))
208+
return PTR_ERR(base);
209209

210210
drvdata->apb_clk = coresight_get_enable_apb_pclk(dev);
211211
if (IS_ERR(drvdata->apb_clk))

0 commit comments

Comments
 (0)