summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArd Biesheuvel <ard.biesheuvel@linaro.org>2016-09-15 13:48:15 +0100
committerArd Biesheuvel <ard.biesheuvel@linaro.org>2016-09-15 15:30:11 +0100
commit38ed4a9e3a65185e7e7b3c891feab1ddc865fdb5 (patch)
treeab91ddd97e1f954d572baf251c9a73a3df66da26
parentf8db6527da8678f1480f08ba99b745279e8d104a (diff)
downloadedk2-38ed4a9e3a65185e7e7b3c891feab1ddc865fdb5.tar.gz
edk2-38ed4a9e3a65185e7e7b3c891feab1ddc865fdb5.tar.bz2
edk2-38ed4a9e3a65185e7e7b3c891feab1ddc865fdb5.zip
ArmVirtPkg/FdtClientDxe: fix check for size of "reg" properties
Currently, the code in FdtClientDxe assumes #address-cells/#size-cells values of <2>. Since DT "reg" properties always consist of <base, size> tuples, this means the size of the entire property should always be a multiple of 16 bytes (i.e, 4 * sizeof(UINT32), not 8. So fix this. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
-rw-r--r--ArmVirtPkg/FdtClientDxe/FdtClientDxe.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c b/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c
index c336e24100..2063a59732 100644
--- a/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c
+++ b/ArmVirtPkg/FdtClientDxe/FdtClientDxe.c
@@ -178,7 +178,7 @@ FindCompatibleNodeReg (
return Status;
}
- if ((*RegSize % 8) != 0) {
+ if ((*RegSize % 16) != 0) {
DEBUG ((EFI_D_ERROR,
"%a: '%a' compatible node has invalid 'reg' property (size == 0x%x)\n",
__FUNCTION__, CompatibleString, *RegSize));