soc: rockchip: power-domain: Add missing kfree in error path

If 'rockchip_pm_add_one_domain' fails, then 'qos_is_need_init[0]'
should be freed, otherwise, there is a memory leak.

Fixes: 2047231d24 ("soc: rockchip: power-domain: support qos init")
Change-Id: Id2ec5c4b7cbc53a5491f348eeba1fd526018875d
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
This commit is contained in:
Tao Huang
2020-07-07 17:17:26 +08:00
parent f236f362d1
commit cd2f3171eb

View File

@@ -880,6 +880,7 @@ static int rockchip_pm_add_one_domain(struct rockchip_pmu *pmu,
return 0;
err_unprepare_clocks:
kfree(qos_is_need_init[0]);
clk_bulk_unprepare(pd->num_clks, pd->clks);
err_put_clocks:
clk_bulk_put(pd->num_clks, pd->clks);