Re: [PATCH v2 1/2] cpufreq: brcmstb-avs-cpufreq: Fix some resource leaks in the error handling path of the probe function

2021-01-17 Thread Viresh Kumar
On 17-01-21, 15:26, 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

[PATCH v2 1/2] cpufreq: brcmstb-avs-cpufreq: Fix some resource leaks in the error handling path of the probe function

2021-01-17 Thread Christophe JAILLET
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).