[coreboot-gerrit] New patch to review for coreboot: b155af9 vendorcode/amd/agesa/f15tn/Proc/CPU/Feature/cpuDmi.c: Fix cast
Edward O'Callaghan (eocallaghan@alterapraxis.com)
gerrit at coreboot.org
Mon Nov 24 14:05:12 CET 2014
Edward O'Callaghan (eocallaghan at alterapraxis.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/7575
-gerrit
commit b155af902ff321d0f1e3d8729203987790f73aed
Author: Edward O'Callaghan <eocallaghan at alterapraxis.com>
Date: Tue Nov 25 00:01:23 2014 +1100
vendorcode/amd/agesa/f15tn/Proc/CPU/Feature/cpuDmi.c: Fix cast
Could lead to possible overflows.
Change-Id: Ib82f8860e240301fda6b06390e6b59b67110bb88
Signed-off-by: Edward O'Callaghan <eocallaghan at alterapraxis.com>
---
src/vendorcode/amd/agesa/f15tn/Proc/CPU/Feature/cpuDmi.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/vendorcode/amd/agesa/f15tn/Proc/CPU/Feature/cpuDmi.c b/src/vendorcode/amd/agesa/f15tn/Proc/CPU/Feature/cpuDmi.c
index 2d62f83..0fcf63a 100644
--- a/src/vendorcode/amd/agesa/f15tn/Proc/CPU/Feature/cpuDmi.c
+++ b/src/vendorcode/amd/agesa/f15tn/Proc/CPU/Feature/cpuDmi.c
@@ -199,7 +199,7 @@ GetDmiInfoMain (
UINT8 Dimm;
UINT16 Index;
UINT16 DimmIndex;
- UINT8 NumberOfDimm;
+ UINT16 NumberOfDimm;
UINT32 MaxCapacity;
UINT64 MsrData;
UINT64 LocalMsrRegister;
@@ -286,7 +286,7 @@ GetDmiInfoMain (
Flag = AGESA_ERROR;
}
} else {
- NumberOfDimm = *((UINT8 *) (LocateHeapParams.BufferPtr));
+ NumberOfDimm = *((UINT16 *) (LocateHeapParams.BufferPtr));
TypeDetail = *((UINT8 *) (LocateHeapParams.BufferPtr) + 1);
MemType = *((DMI_T17_MEMORY_TYPE *) ((UINT8 *) (LocateHeapParams.BufferPtr) + 6));
MemInfo = (MEM_DMI_INFO *) ((UINT8 *) (LocateHeapParams.BufferPtr) + 6 + sizeof (DMI_T17_MEMORY_TYPE));
@@ -314,7 +314,7 @@ GetDmiInfoMain (
DmiBufferPtr->T16.ExtMaxCapacity = (UINT64) MaxCapacity << 20;
}
- DmiBufferPtr->T16.NumberOfMemoryDevices = (UINT16) NumberOfDimm;
+ DmiBufferPtr->T16.NumberOfMemoryDevices = NumberOfDimm;
// TYPE 17
for (DimmIndex = 0; DimmIndex < NumberOfDimm; DimmIndex++) {
More information about the coreboot-gerrit
mailing list