cpufreq: OMAP: fix freq_table leak
authorNishanth Menon <nm@ti.com>
Wed, 7 Dec 2011 20:09:38 +0000 (12:09 -0800)
committerTony Lindgren <tony@atomide.com>
Wed, 7 Dec 2011 20:09:38 +0000 (12:09 -0800)
commitf257eb95fe7b3b7060f5dc3c8bb757660c808ebc
tree537c20cbac4f28a115c6e8d8f94e603f48812cc1
parentf71614bb2519958b80d44b71f106a5d1d83b36ed
cpufreq: OMAP: fix freq_table leak

We use a single frequency table for multiple CPUs. But, with
OMAP4, since we have multiple CPUs, the cpu_init call for CPU1
causes freq_table previously allocated for CPU0 to be overwritten.
In addition, we dont free the table on exit path.

We solve this by maintaining an atomic type counter to ensure
just a single table exists at a given time.

Signed-off-by: Nishanth Menon <nm@ti.com>
Signed-off-by: Kevin Hilman <khilman@ti.com>
drivers/cpufreq/omap-cpufreq.c