Coresight: Fix a NULL vs IS_ERR() bug in probe
PATCH 1/1 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.
--- drivers/hwtracing/coresight/coresight-ctcu-core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/hwtracing/coresight/coresight-ctcu-core.c +2 -2
@@ -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))
Signature · 1 line
2.47.2
Quoted 15 lines · Dan Carpenter
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 <[email protected]>--- drivers/hwtracing/coresight/coresight-ctcu-core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/hwtracing/coresight/coresight-ctcu-core.c +0
-0
drivers/hwtracing/coresight/coresight-ctcu-core.c static int ctcu_probe(struct platform_device *pdev) · line 211
Quoted 10 lines
drivers/hwtracing/coresight/coresight-ctcu-core.c +2
-2@@ -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))
Thanks for fix it. Looks good to me.
Jie
Quoted 15 lines · Dan Carpenter
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 <[email protected]>--- drivers/hwtracing/coresight/coresight-ctcu-core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/hwtracing/coresight/coresight-ctcu-core.c +0
-0
drivers/hwtracing/coresight/coresight-ctcu-core.c static int ctcu_probe(struct platform_device *pdev) · line 211
Quoted 10 lines
drivers/hwtracing/coresight/coresight-ctcu-core.c +2
-2@@ -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))
Quoted 5 lines · Dan Carpenter
The
devm_platform_get_and_ioremap_resource()function doesn't return NULL, it returns error pointers. Update the checking to match.
Applied, thanks!
[1/1] Coresight: Fix a NULL vs IS_ERR() bug in probe
(no commit info)
Best regards,
Signature · 1 line
Suzuki K Poulose <[email protected]>