Skip to content

Commit f783d74

Browse files
committed
Merge tag 'mtk-soc-for-v6.14' of https://git.kernel.org/pub/scm/linux/kernel/git/mediatek/linux into soc/drivers
MediaTek soc driver updates for v6.14 This adds fixes avoiding iomap leaks on error paths in the MediaTek devapc driver. * tag 'mtk-soc-for-v6.14' of https://git.kernel.org/pub/scm/linux/kernel/git/mediatek/linux: soc: mediatek: mtk-devapc: Fix leaking IO map on driver remove soc: mediatek: mtk-devapc: Fix leaking IO map on error paths Link: https://lore.kernel.org/r/20250108100826.32458-2-angelogioacchino.delregno@collabora.com Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2 parents 25205fe + c9c0036 commit f783d74

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

drivers/soc/mediatek/mtk-devapc.c

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -273,30 +273,39 @@ static int mtk_devapc_probe(struct platform_device *pdev)
273273
return -EINVAL;
274274

275275
devapc_irq = irq_of_parse_and_map(node, 0);
276-
if (!devapc_irq)
277-
return -EINVAL;
276+
if (!devapc_irq) {
277+
ret = -EINVAL;
278+
goto err;
279+
}
278280

279281
ctx->infra_clk = devm_clk_get_enabled(&pdev->dev, "devapc-infra-clock");
280-
if (IS_ERR(ctx->infra_clk))
281-
return -EINVAL;
282+
if (IS_ERR(ctx->infra_clk)) {
283+
ret = -EINVAL;
284+
goto err;
285+
}
282286

283287
ret = devm_request_irq(&pdev->dev, devapc_irq, devapc_violation_irq,
284288
IRQF_TRIGGER_NONE, "devapc", ctx);
285289
if (ret)
286-
return ret;
290+
goto err;
287291

288292
platform_set_drvdata(pdev, ctx);
289293

290294
start_devapc(ctx);
291295

292296
return 0;
297+
298+
err:
299+
iounmap(ctx->infra_base);
300+
return ret;
293301
}
294302

295303
static void mtk_devapc_remove(struct platform_device *pdev)
296304
{
297305
struct mtk_devapc_context *ctx = platform_get_drvdata(pdev);
298306

299307
stop_devapc(ctx);
308+
iounmap(ctx->infra_base);
300309
}
301310

302311
static struct platform_driver mtk_devapc_driver = {

0 commit comments

Comments
 (0)