Re: [PATCH] ASoC: ak4642: Return of_clk_add_provider to transfer the error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



On Wed, Jul 17, 2024 at 07:40:24PM +0800, Ma Ke wrote:

>  	clk = clk_register_fixed_rate(dev, clk_name, parent_clk_name, 0, rate);
> -	if (!IS_ERR(clk))
> -		of_clk_add_provider(np, of_clk_src_simple_get, clk);
> +	if (!IS_ERR(clk)) {
> +		ret = of_clk_add_provider(np, of_clk_src_simple_get, clk);
> +		if (ret)
> +			return ERR_PTR(ret);
> +	}

This will leak clk if adding the provider fails.

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Pulseaudio]     [Linux Audio Users]     [ALSA Devel]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux