[PATCH 1/1] mtd:nand:fix memory leak

Marc Gonzalez marc.w.gonzalez at free.fr
Thu Apr 5 05:00:39 PDT 2018


On 05/04/2018 13:47, Boris Brezillon wrote:

> On Thu, 5 Apr 2018 13:26:31 +0200, Marc Gonzalez wrote:
> 
>> IIUC, you're saying:
>> 1) use devm_clk_get() instead of clk_get() to solve the memory leak
>> 2) call clk_prepare_enable() before clk_get_rate() even if the former is a no-op today
> 
> + a disable_unprepare() in the remove path and a another one in the
> error path (in case something fails after prepare_enable() has been
> called).

I hate C error-handling with all my heart...

Why is it taking so long for Linux APIs to be turned into devm
managed functions? It makes life so much easier...



More information about the linux-mtd mailing list