Re: [PATCH v5 1/2] thermal: mediatek: use devm_of_iomap to avoid resource leak in mtk_thermal_probe

From: Daniel Lezcano
Date: Wed Apr 19 2023 - 03:38:26 EST


On 19/04/2023 04:07, Kang Chen wrote:
Smatch reports:
1. mtk_thermal_probe() warn: 'apmixed_base' from of_iomap() not released.
2. mtk_thermal_probe() warn: 'auxadc_base' from of_iomap() not released.

The original code forgets to release iomap resource when handling errors,
fix it by switch to devm_of_iomap.

Fixes: 89945047b166 ("thermal: mediatek: Add tsensor support for V2 thermal system")
Signed-off-by: Kang Chen <void0red@xxxxxxxxxxx>
Reviewed-by: Dongliang Mu <dzm91@xxxxxxxxxxx>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@xxxxxxxxxxxxx>
---

Dropped v4 and applied v5

Thanks

--
<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog