]> www.infradead.org Git - users/jedix/linux-maple.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)
committerUlf Hansson <ulf.hansson@linaro.org>
Mon, 2 Dec 2024 16:06:09 +0000 (17:06 +0100)
commit3e3b71d35a02cee4b2cc3d4255668a6609165518
treecc56bbb1d8ce70c972a58ba0cf29bdebe040e5c4
parentb8f7bbd1f4ecff6d6277b8c454f62bb0a1c6dbe4
pmdomain: core: Fix error path in pm_genpd_init() when ida alloc fails

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>
drivers/pmdomain/core.c