]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmVirtPkg/FdtClientDxe: fix check for size of "reg" properties
authorArd Biesheuvel <ard.biesheuvel@linaro.org>
Thu, 15 Sep 2016 12:48:15 +0000 (13:48 +0100)
committerArd Biesheuvel <ard.biesheuvel@linaro.org>
Thu, 15 Sep 2016 14:30:11 +0000 (15:30 +0100)
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>
ArmVirtPkg/FdtClientDxe/FdtClientDxe.c

index c336e2410033e2832db06fa98d2517a4948edc10..2063a597323b6cccd2d089324af73907a2c84982 100644 (file)
@@ -178,7 +178,7 @@ FindCompatibleNodeReg (
     return Status;\r
   }\r
 \r
     return Status;\r
   }\r
 \r
-  if ((*RegSize % 8) != 0) {\r
+  if ((*RegSize % 16) != 0) {\r
     DEBUG ((EFI_D_ERROR,\r
       "%a: '%a' compatible node has invalid 'reg' property (size == 0x%x)\n",\r
       __FUNCTION__, CompatibleString, *RegSize));\r
     DEBUG ((EFI_D_ERROR,\r
       "%a: '%a' compatible node has invalid 'reg' property (size == 0x%x)\n",\r
       __FUNCTION__, CompatibleString, *RegSize));\r