RE: [PATCH] clk: imx: imx8qxp-lpcg: fix runtime PM cleanup on error path

"Peng Fan (OSS)" <[email protected]>
Newsgroups dev.linux.lists.imx,org.infradead.lists.linux-arm-kernel,org.kernel.vger.linux-clk,org.kernel.vger.linux-kernel,org.kernel.vger.stable
Message-ID <MRWPR04MB12330DF8BEF971E044EDE4A1788DE2@MRWPR04MB12330.eurprd04.prod.outlook.com>
> Subject: [PATCH] clk: imx: imx8qxp-lpcg: fix runtime PM cleanup on
> error path
> 
> imx_lpcg_parse_clks_from_dt() takes a runtime PM usage reference
> with
> pm_runtime_get_noresume() and enables autosuspend with
> pm_runtime_use_autosuspend(). The success path drops the usage
> reference with pm_runtime_put_autosuspend(), but the error path only
> disables runtime PM.
> 
> As a result, the reference taken by pm_runtime_get_noresume()
> remains unbalanced on registration failure. The autosuspend setting is
> also left enabled instead of being undone with
> pm_runtime_dont_use_autosuspend().
> 
> Add pm_runtime_dont_use_autosuspend() to undo the autosuspend
> setting and pm_runtime_put_noidle() to drop the usage reference on
> the error path.
> 
> This issue was found by manual code inspection.
> 
> Fixes: 18cdbad40c6c ("clk: imx: clk-imx8qxp-lpcg: add runtime pm
> support")
> Cc: [email protected]
> Signed-off-by: Guangshuo Li <[email protected]>

Reviewed-by: Peng Fan <[email protected]>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.