[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1cba966a-2485-3333-40fd-26ffa1c3d78f@gmail.com>
Date: Mon, 21 Dec 2020 15:00:19 -0800
From: Florian Fainelli <f.fainelli@...il.com>
To: Christophe JAILLET <christophe.jaillet@...adoo.fr>,
mmayer@...adcom.com, bcm-kernel-feedback-list@...adcom.com,
rjw@...ysocki.net, viresh.kumar@...aro.org, f.fainelli@...il.com
Cc: linux-pm@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] cpufreq: brcmstb-avs-cpufreq: Fix some resource leaks in
the error handling path of the probe function
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@...adoo.fr>
Acked-by: Florian Fainelli <f.fainelli@...il.com>
We could have considered switching to device managed APIs for automatic
cleanup, but this will do as well. Thanks Christophe.
--
Florian
Powered by blists - more mailing lists