1 From: Tobias Wolf <dev-NTEO@vplace.de>
2 Date: Wed, 23 Nov 2016 10:40:07 +0100
3 Subject: [PATCH] of: Add check to of_scan_flat_dt() before accessing
6 An empty __dtb_start to __dtb_end section might result in initial_boot_params
7 being null for arch/mips/ralink. This showed that the boot process hangs
8 indefinitely in of_scan_flat_dt().
10 Signed-off-by: Tobias Wolf <dev-NTEO@vplace.de>
13 --- a/drivers/of/fdt.c
14 +++ b/drivers/of/fdt.c
15 @@ -632,9 +632,12 @@ int __init of_scan_flat_dt(int (*it)(uns
17 int offset, rc = 0, depth = -1;
19 - for (offset = fdt_next_node(blob, -1, &depth);
20 - offset >= 0 && depth >= 0 && !rc;
21 - offset = fdt_next_node(blob, offset, &depth)) {
25 + for (offset = fdt_next_node(blob, -1, &depth);
26 + offset >= 0 && depth >= 0 && !rc;
27 + offset = fdt_next_node(blob, offset, &depth)) {
29 pathp = fdt_get_name(blob, offset, NULL);