From 420a357a1b43c57383c74a548a9a3714b6da7de2 Mon Sep 17 00:00:00 2001 From: Zhou Peng Date: Thu, 14 May 2020 14:48:09 +0800 Subject: [PATCH] MLK-24009-3 arm64: imx8mm: vpu: h1: fix build issue as module release clk to avoid memory leak Signed-off-by: Zhou Peng --- drivers/mxc/hantro_845_h1/hx280enc.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/mxc/hantro_845_h1/hx280enc.c b/drivers/mxc/hantro_845_h1/hx280enc.c index 3859e8233a6d..3d7fc3b472aa 100755 --- a/drivers/mxc/hantro_845_h1/hx280enc.c +++ b/drivers/mxc/hantro_845_h1/hx280enc.c @@ -845,6 +845,11 @@ static int hantro_h1_dev_remove(struct platform_device *pdev) pm_runtime_disable(&pdev->dev); hantro_h1_clk_disable(&pdev->dev); + if (!IS_ERR(hantro_clk_h1)) + clk_put(hantro_clk_h1); + if (!IS_ERR(hantro_clk_h1_bus)) + clk_put(hantro_clk_h1_bus); + return 0; } @@ -909,7 +914,6 @@ static int __init hantro_h1_init(void) static void __exit hantro_h1_exit(void) { - //clk_put(hantro_clk); platform_driver_unregister(&mxchantro_h1_driver); }