diff options
author | AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> | 2023-06-15 14:20:51 +0200 |
---|---|---|
committer | Stephen Boyd <sboyd@kernel.org> | 2023-06-16 21:20:26 +0200 |
commit | b270ae61730e0ebccee39a21dd3311d6896a38ae (patch) | |
tree | 9c2111419c4e64ed82cd5045c1f76e4be65f1ac1 /drivers/clk/mediatek | |
parent | clk: mediatek: clk-mt8173-apmixedsys: Fix return value for of_iomap() error (diff) | |
download | linux-b270ae61730e0ebccee39a21dd3311d6896a38ae.tar.xz linux-b270ae61730e0ebccee39a21dd3311d6896a38ae.zip |
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: 41138fbf876c ("clk: mediatek: mt8173: Migrate to platform driver and common probe")
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/20230615122051.546985-4-angelogioacchino.delregno@collabora.com
Reviewed-by: Chen-Yu Tsai <wenst@chromium.org>
Signed-off-by: Stephen Boyd <sboyd@kernel.org>
Diffstat (limited to 'drivers/clk/mediatek')
-rw-r--r-- | drivers/clk/mediatek/clk-mt8173-apmixedsys.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/clk/mediatek/clk-mt8173-apmixedsys.c b/drivers/clk/mediatek/clk-mt8173-apmixedsys.c index c7adcfcc12e2..307c24aa1fb4 100644 --- a/drivers/clk/mediatek/clk-mt8173-apmixedsys.c +++ b/drivers/clk/mediatek/clk-mt8173-apmixedsys.c @@ -151,8 +151,10 @@ static int clk_mt8173_apmixed_probe(struct platform_device *pdev) return -ENOMEM; clk_data = mtk_alloc_clk_data(CLK_APMIXED_NR_CLK); - if (IS_ERR_OR_NULL(clk_data)) + if (IS_ERR_OR_NULL(clk_data)) { + iounmap(base); return -ENOMEM; + } fhctl_parse_dt(fhctl_node, pllfhs, ARRAY_SIZE(pllfhs)); r = mtk_clk_register_pllfhs(node, plls, ARRAY_SIZE(plls), @@ -186,6 +188,7 @@ unregister_plls: ARRAY_SIZE(pllfhs), clk_data); free_clk_data: mtk_free_clk_data(clk_data); + iounmap(base); return r; } |