Re: [PATCH] cpufreq: qcom-hw: add missing devm_release_mem_region() call

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

 



On 12-01-21, 08:44, Bjorn Andersson wrote:
> Intuitively I feel that resources allocated in cpufreq_driver->init()
> should be explicitly freed in cpufreq_driver->exit() and should thereby
> not use devm to track the allocations.

I agree.

> But afaict when qcom_cpufreq_hw_driver_remove() calls
> cpufreq_unregister_driver() to end up in cpufreq_remove_dev() it will
> only call cpufreq_driver->exit() iff cpufreq_driver->offline() is
> implemented - which it isn't in our case.

cpufreq_offline() calls exit() in your case. So no memory leak here.

> So without using devm to track
> this we would leak the memory - which also implies that we're leaking
> the "freq_table" when this happens.
> 
> But isn't that simply a typo in cpufreq_remove_dev()? And can't we just
> use ioremap()/iounmap() here instead?

-- 
viresh



[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