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