1
0
Fork 0

MLK-24009-4 arm64: imx8mq: vpu: g1/g2: fix build issue as module

fix clk use-after-free issue

Signed-off-by: Zhou Peng <eagle.zhou@nxp.com>
5.4-rM2-2.2.x-imx-squashed
Zhou Peng 2020-05-14 15:18:51 +08:00
parent 420a357a1b
commit 0d1b3814c9
1 changed files with 8 additions and 6 deletions

View File

@ -1858,6 +1858,13 @@ static int hantro_dev_remove(struct platform_device *pdev)
pm_runtime_disable(&pdev->dev);
hantro_clk_disable(&pdev->dev);
if (!IS_ERR(hantro_clk_g1))
clk_put(hantro_clk_g1);
if (!IS_ERR(hantro_clk_g2))
clk_put(hantro_clk_g2);
if (!IS_ERR(hantro_clk_bus))
clk_put(hantro_clk_bus);
#ifdef CONFIG_DEVICE_THERMAL
HANTRO_UNREG_THERMAL_NOTIFIER(&hantro_thermal_hot_notifier);
#endif
@ -1924,12 +1931,7 @@ static int __init hantro_init(void)
static void __exit hantro_exit(void)
{
if (!IS_ERR(hantro_clk_g1))
clk_put(hantro_clk_g1);
if (!IS_ERR(hantro_clk_g2))
clk_put(hantro_clk_g2);
if (!IS_ERR(hantro_clk_bus))
clk_put(hantro_clk_bus);
#if 0
if (!IS_ERR(hantro_regulator))
regulator_put(hantro_regulator);