John Zhao would like John Zhao to review this change.

View Change

cpu/x86: Initialize the argument value msr_index

Clang Static Analyzer version 8.0.0 treats the uninitialized argument
value msr_index as logic error in a function call. Just set msr_index
with 0 initially.

Change-Id: I051b290998207a1129ada06bb455f44c2d291975
Signed-off-by: John Zhao <john.zhao@intel.com>
---
M src/cpu/x86/mtrr/mtrr.c
1 file changed, 1 insertion(+), 0 deletions(-)

git pull ssh://review.coreboot.org:29418/coreboot refs/changes/49/34249/1
diff --git a/src/cpu/x86/mtrr/mtrr.c b/src/cpu/x86/mtrr/mtrr.c
index 98449d5..4dc71d6 100644
--- a/src/cpu/x86/mtrr/mtrr.c
+++ b/src/cpu/x86/mtrr/mtrr.c
@@ -321,6 +321,7 @@

fixed_mtrrs_expose_amd_rwdram();

+ memset(&msr_index, 0, sizeof(msr_index));
memset(&fixed_msrs, 0, sizeof(fixed_msrs));

msr_num = 0;

To view, visit change 34249. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Change-Id: I051b290998207a1129ada06bb455f44c2d291975
Gerrit-Change-Number: 34249
Gerrit-PatchSet: 1
Gerrit-Owner: John Zhao <john.zhao@intel.corp-partner.google.com>
Gerrit-Reviewer: John Zhao <john.zhao@intel.com>
Gerrit-MessageType: newchange