[PATCH] cpufreq: brcmstb-avs-cpufreq: Fix some resource leaks in the error handling path of the probe function
Florian Fainelli
f.fainelli at gmail.com
Mon Dec 21 18:00:19 EST 2020
On 12/19/2020 2:17 AM, Christophe JAILLET wrote:
> If 'cpufreq_register_driver()' fails, we must release the resources
> allocated in 'brcm_avs_prepare_init()' as already done in the remove
> function.
>
> To do that, introduce a new function 'brcm_avs_prepare_uninit()' in order
> to avoid code duplication. This also makes the code more readable (IMHO).
>
> Fixes: de322e085995 ("cpufreq: brcmstb-avs-cpufreq: AVS CPUfreq driver for Broadcom STB SoCs")
> Signed-off-by: Christophe JAILLET <christophe.jaillet at wanadoo.fr>
Acked-by: Florian Fainelli <f.fainelli at gmail.com>
We could have considered switching to device managed APIs for automatic
cleanup, but this will do as well. Thanks Christophe.
--
Florian
More information about the linux-arm-kernel
mailing list