Re: [PATCH] bus: qcom-ebi2: Fix clock leak on probe failure
From: Konrad Dybcio
Date: Mon Jun 22 2026 - 05:32:20 EST
On 6/20/26 10:04 AM, Ruoyu Wang wrote:
> qcom_ebi2_probe() enables the EBI2X and EBI2 clocks before it walks
> child nodes and populates child devices. If reading a child node's reg
> property fails, or if of_platform_default_populate() fails, probe returns
> without disabling either clock.
>
> Route those failure paths through the existing clock cleanup labels so a
> failed probe does not leave the clocks prepared and enabled.
>
> Fixes: 335a12754808 ("bus: qcom: add EBI2 driver")
> Signed-off-by: Ruoyu Wang <ruoyuw560@xxxxxxxxx>
> ---
> This is a minimal error-path fix for a previously reported leak. A broader
> devm_clk_get_enabled() conversion was posted in 2023 and reviewed, and a
> similar cleanup was posted in 2024, but neither appears in current upstream:
> https://lkml.iu.edu/hypermail/linux/kernel/2305.1/00605.html
> https://lkml.iu.edu/2408.2/09536.html
Someone raised an identical patch last week
https://lore.kernel.org/linux-arm-msm/d1882207-4756-4e65-ba30-b47ccc821fd4@xxxxxxxxxxxxxxxx/
Konrad