Re: [PATCH] ASoC: ti: davinci-mcasp: Fix runtime PM imbalance in __davinci_mcasp_set_clkdiv()

From: Wang, Sen

Date: Wed Sep 16 2026 - 15:05:39 EST


On 9/16/2026 2:31 AM, Wentao Liang wrote:
In __davinci_mcasp_set_clkdiv(), pm_runtime_get_sync() is called at the
entry of the function. If an invalid div_id is provided, the function
hits the default switch case and directly returns -EINVAL without calling
pm_runtime_put(), resulting in a runtime PM reference leak.

Add pm_runtime_put() in the default case before returning -EINVAL.

Fixes: 4ed8c9b737b6 ("ASoC: McASP: add support for clock dividers")
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Wentao Liang <vulab@xxxxxxxxxxx>
Hi Wentao, thanks for the catch!

Manual runtime PM reference is quite tedious and results in reference leak like you've pinpointed, maybe it's better to convert to a guard()/ACQUIRE() based approach in the future...

Assuming you took Greg's input if you need to submit a V2:

Tested-by: Sen Wang <sen@xxxxxx>