Re: [PATCH] clk: fixed: fix double free in resource managed fixed-factor clock

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

 



Quoting Dmitry Baryshkov (2021-04-07 17:52:01)
>
> Short story: no other patches needed.
> 
> Long story:
> I've checked the rest of devres allocations in clk subsystem.
> Interesting, they use a bit different pattern: they devres_alloc a
> pointer to the clock, then they fill the pointer with the new clock
> data. The release callback would (correctly) free the clock pointer by
> the devres and then devres code would kfree the devres data (clock
> pointer).
> 
> The fixed-factor is unique in this area, because it devres_alloc's a
> clock instance (rather than the pointer) and then fills it, so it
> should not be freed in the release callback (only unregistered) with
> the devres code kfreeing() the instance itself.
> 
> 

Cool thanks for checking. Maybe we should change those other callers in
clk directory to devres alloc the container structure instead of a
pointer. Then we avoid the double allocation. Glad it's not a critical
fix though.




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [Linux for Sparc]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux