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: a77b2a0b12
("soc: qcom: Introduce RPM master stats driver")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: Bjorn Andersson <andersson@kernel.org>
Link: https://lore.kernel.org/r/ZH7sgpLAN23bCz9v@moroto
This commit is contained in:
Родитель
d9c2a255cf
Коммит
3aed112953
|
@ -105,7 +105,7 @@ static int master_stats_probe(struct platform_device *pdev)
|
||||||
}
|
}
|
||||||
|
|
||||||
data[i].base = devm_ioremap(dev, res.start, resource_size(&res));
|
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);
|
debugfs_remove_recursive(root);
|
||||||
return dev_err_probe(dev, -EINVAL,
|
return dev_err_probe(dev, -EINVAL,
|
||||||
"Could not map the MSG RAM slice idx %d!\n", i);
|
"Could not map the MSG RAM slice idx %d!\n", i);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче