If the memory resource for a TSC is unviable probe should fail not try to go ahead with the remaining TSC. This fix is aligned with other checks in probe where probe fails if they are unavailable. Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@xxxxxxxxxxxx> --- drivers/thermal/rcar_gen3_thermal.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/thermal/rcar_gen3_thermal.c b/drivers/thermal/rcar_gen3_thermal.c index ec477d47d0bae8e5..97958f91047b4c3a 100644 --- a/drivers/thermal/rcar_gen3_thermal.c +++ b/drivers/thermal/rcar_gen3_thermal.c @@ -289,8 +289,10 @@ static int rcar_gen3_thermal_probe(struct platform_device *pdev) } res = platform_get_resource(pdev, IORESOURCE_MEM, i); - if (!res) - break; + if (!res) { + ret = -ENODEV; + goto error_unregister; + } tsc->base = devm_ioremap_resource(dev, res); if (IS_ERR(tsc->base)) { -- 2.12.0