diff options
author | Patrick Georgi <patrick@georgi-clan.de> | 2015-02-22 16:27:56 +0100 |
---|---|---|
committer | Patrick Georgi <pgeorgi@google.com> | 2015-03-05 20:57:33 +0100 |
commit | aab66b1dc7908366f35ed58b774bb2dbe214278c (patch) | |
tree | febf70ac47d3f4a4398fa16500eae51f6c48a0e2 | |
parent | f752d013b0cede9e7d4a8463827b6ef3a8238e0d (diff) | |
download | coreboot-aab66b1dc7908366f35ed58b774bb2dbe214278c.tar.xz |
AMD Fam10h: sanity check some CPU data
If a certain register returns crap values, we
determine core_power using an uninitialized variable.
That doesn't sound healthy.
Change-Id: I1e890b78bfcc3bf0255a3d4f6561a783134b1719
Signed-off-by: Patrick Georgi <patrick@georgi-clan.de>
Found-by: Coverity Scan
Reviewed-on: http://review.coreboot.org/8508
Reviewed-by: Timothy Pearson <tpearson@raptorengineeringinc.com>
Tested-by: build bot (Jenkins)
Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
-rw-r--r-- | src/cpu/amd/model_10xxx/powernow_acpi.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/cpu/amd/model_10xxx/powernow_acpi.c b/src/cpu/amd/model_10xxx/powernow_acpi.c index feb8f01f60..09726a0cda 100644 --- a/src/cpu/amd/model_10xxx/powernow_acpi.c +++ b/src/cpu/amd/model_10xxx/powernow_acpi.c @@ -223,6 +223,11 @@ static void pstates_algorithm(u32 pcontrol_blk, u8 plen, u8 onlyBSP) case 0x3: expanded_cpuidv = 1000; break; + default: + printk(BIOS_ERR, "%s:%s:%d: Invalid cpuidv, " + "not generating pstate tables.\n", + __FILE__, __func__, __LINE__); + return; } core_power = (core_voltage * cpuidd) / (expanded_cpuidv * 10); |