]> git.karo-electronics.de Git - karo-tx-linux.git/commit
CPUFREQ: Fix use after free of struct powernow_k8_data
authorThomas Renninger <trenn@suse.de>
Mon, 14 Dec 2009 10:44:15 +0000 (11:44 +0100)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 1 Apr 2010 22:55:28 +0000 (15:55 -0700)
commite8772825003228c6c5dd94af7238a1b1fc12ec68
tree2e17e76321e7d6a58e2229e374d2253e1fa66e2e
parentb7f7ed5565c30f4e1058d7c97c49fe52e0136ee9
CPUFREQ: Fix use after free of struct powernow_k8_data

commit 557a701c16553b0b691dbb64ef30361115a80f64 upstream.

Easy fix for a regression introduced in 2.6.31.

On managed CPUs the cpufreq.c core will call driver->exit(cpu) on the
managed cpus and powernow_k8 will free the core's data.

Later driver->get(cpu) function might get called trying to read out the
current freq of a managed cpu and the NULL pointer check does not work on
the freed object -> better set it to NULL.

->get() is unsigned and must return 0 as invalid frequency.

Reference:
http://bugzilla.kernel.org/show_bug.cgi?id=14391

Signed-off-by: Thomas Renninger <trenn@suse.de>
Tested-by: Michal Schmidt <mschmidt@redhat.com>
Signed-off-by: Dave Jones <davej@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
arch/x86/kernel/cpu/cpufreq/powernow-k8.c