]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
pmdomain: core: Fix error path in pm_genpd_init() when ida alloc fails
authorUlf Hansson <ulf.hansson@linaro.org>
Fri, 22 Nov 2024 13:42:03 +0000 (14:42 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 14 Dec 2024 19:03:16 +0000 (20:03 +0100)
commit913a3f1c06a4568f22bc1651912860fec65fbb11
tree261d1276b57a8e5d362ee5411353c7d1809c93c5
parenta78af1180623f85a0deffc828cadf56ff6a3c721
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>
drivers/pmdomain/core.c