pmdomain: core: Fix error path in pm_genpd_init() when ida alloc fails
[ Upstream commit
3e3b71d35a02cee4b2cc3d4255668a6609165518 ]
When the ida allocation fails we need to free up the previously allocated
memory before returning the error code. Let's fix this and while at it,
let's also move the ida allocation to genpd_alloc_data() and the freeing to
genpd_free_data(), as it better belongs there.
Fixes: 899f44531fe6 ("pmdomain: core: Add GENPD_FLAG_DEV_NAME_FW flag")
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Message-ID: <
20241122134207.157283-3-ulf.hansson@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>