+15
drivers/of/fdt.c
+15
drivers/of/fdt.c
···
880
880
const u64 phys_offset = __pa(PAGE_OFFSET);
881
881
base &= PAGE_MASK;
882
882
size &= PAGE_MASK;
883
+
884
+
if (sizeof(phys_addr_t) < sizeof(u64)) {
885
+
if (base > ULONG_MAX) {
886
+
pr_warning("Ignoring memory block 0x%llx - 0x%llx\n",
887
+
base, base + size);
888
+
return;
889
+
}
890
+
891
+
if (base + size > ULONG_MAX) {
892
+
pr_warning("Ignoring memory range 0x%lx - 0x%llx\n",
893
+
ULONG_MAX, base + size);
894
+
size = ULONG_MAX - base;
895
+
}
896
+
}
897
+
883
898
if (base + size < phys_offset) {
884
899
pr_warning("Ignoring memory block 0x%llx - 0x%llx\n",
885
900
base, base + size);