Skip to content

Commit b270ae6

Browse files
AngeloGioacchino Del Regnobebarino
authored andcommitted
clk: mediatek: clk-mt8173-apmixedsys: Fix iomap not released issue
In case of error after of_ioremap() the resource must be released: call iounmap() where appropriate to fix that. Fixes: 41138fb ("clk: mediatek: mt8173: Migrate to platform driver and common probe") Signed-off-by: AngeloGioacchino Del Regno <[email protected]> Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Chen-Yu Tsai <[email protected]> Signed-off-by: Stephen Boyd <[email protected]>
1 parent 3dc265b commit b270ae6

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/clk/mediatek/clk-mt8173-apmixedsys.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,10 @@ static int clk_mt8173_apmixed_probe(struct platform_device *pdev)
151151
return -ENOMEM;
152152

153153
clk_data = mtk_alloc_clk_data(CLK_APMIXED_NR_CLK);
154-
if (IS_ERR_OR_NULL(clk_data))
154+
if (IS_ERR_OR_NULL(clk_data)) {
155+
iounmap(base);
155156
return -ENOMEM;
157+
}
156158

157159
fhctl_parse_dt(fhctl_node, pllfhs, ARRAY_SIZE(pllfhs));
158160
r = mtk_clk_register_pllfhs(node, plls, ARRAY_SIZE(plls),
@@ -186,6 +188,7 @@ static int clk_mt8173_apmixed_probe(struct platform_device *pdev)
186188
ARRAY_SIZE(pllfhs), clk_data);
187189
free_clk_data:
188190
mtk_free_clk_data(clk_data);
191+
iounmap(base);
189192
return r;
190193
}
191194

0 commit comments

Comments
 (0)