[PATCH] clk: samsung: exynos5410: fix refcount leak

Alexey Klimov alexey.klimov at linaro.org
Wed May 27 18:15:33 PDT 2026


On Tue May 26, 2026 at 7:13 AM BST, Alexander A. Klimov wrote:
> Every value returned from of_clk_get() is supposed to be cleaned up
> via clk_put() once not needed anymore.
>
> Fixes: be95d2c7d918 ("clk: samsung: Add support for EPLL on exynos5410")
> Signed-off-by: Alexander A. Klimov <grandmaster at al2klimov.de>

Reviewed-by: Alexey Klimov <alexey.klimov at linaro.org>

> ---
>  drivers/clk/samsung/clk-exynos5410.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/clk/samsung/clk-exynos5410.c b/drivers/clk/samsung/clk-exynos5410.c
> index baa9988c7bb7..0cd9b0392cf5 100644
> --- a/drivers/clk/samsung/clk-exynos5410.c
> +++ b/drivers/clk/samsung/clk-exynos5410.c
> @@ -269,8 +269,12 @@ static void __init exynos5410_clk_init(struct device_node *np)
>  {
>  	struct clk *xxti = of_clk_get(np, 0);
>  
> -	if (!IS_ERR(xxti) && clk_get_rate(xxti) == 24 * MHZ)
> -		exynos5410_plls[epll].rate_table = exynos5410_pll2550x_24mhz_tbl;
> +	if (!IS_ERR(xxti)) {
> +		if (clk_get_rate(xxti) == 24 * MHZ)
> +			exynos5410_plls[epll].rate_table =
> +				exynos5410_pll2550x_24mhz_tbl;
> +		clk_put(xxti);
> +	}
>  
>  	samsung_cmu_register_one(np, &cmu);

Best regards,
Alexey Klimov




More information about the linux-arm-kernel mailing list