soc: qcom: Fix a IS_ERR() vs NULL bug in probe
Subsystems (3)
PATCH 1/1 soc: qcom: Fix a IS_ERR() vs NULL bug in probe
The devm_ioremap() function returns NULL on error, it never returns error pointers.
Fixes a77b2a0b1280 ("soc: qcom: Introduce RPM master stats driver")
Signed-off-by Dan Carpenter <[email protected]>
--- drivers/soc/qcom/rpm_master_stats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/soc/qcom/rpm_master_stats.c +1 -1
@@ -105,7 +105,7 @@ static int master_stats_probe(struct platform_device *pdev) } data[i].base =devm_ioremap (dev, res.start,resource_size (&res)); -if (IS_ERR (data[i].base)) { +if (!data[i].base) {debugfs_remove_recursive (root);return dev_err_probe (dev, -EINVAL ,"Could not map the MSG RAM slice idx %d!\n" , i);
Signature · 1 line
2.30.2
Quoted 6 lines · Dan Carpenter
The
devm_ioremap()function returns NULL on error, it never returns error pointers.Fixes a77b2a0b1280 ("soc: qcom: Introduce RPM master stats driver")Signed-off-by Dan Carpenter <[email protected]>---
Thanks!
Reviewed-by Konrad Dybcio <[email protected]>
Konrad
Quoted 16 lines
drivers/soc/qcom/rpm_master_stats.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/soc/qcom/rpm_master_stats.c +1
-1@@ -105,7 +105,7 @@ static int master_stats_probe(struct platform_device *pdev) } data[i].base =devm_ioremap (dev, res.start,resource_size (&res)); -if (IS_ERR (data[i].base)) { +if (!data[i].base) {debugfs_remove_recursive (root);return dev_err_probe (dev, -EINVAL ,"Could not map the MSG RAM slice idx %d!\n" , i);
Quoted 4 lines · Dan Carpenter
The
devm_ioremap()function returns NULL on error, it never returns error pointers.
Applied, thanks!
[1/1] soc: qcom: Fix a IS_ERR() vs NULL bug in probe
commit: 3aed112953b1877ede66ae77afa4e5a5024be7cb
Best regards,
Signature · 1 line
Bjorn Andersson <[email protected]>