Re: [PATCH 2/2 v2] of: Add check to of_scan_flat_dt() before accessing initial_boot_params

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello.

On 11/23/2016 9:11 AM, Tobias Wolf wrote:

An empty __dtb_start to __dtb_end section might result in initial_boot_params
being null for arch/mips/ralink. This showed that the boot process hangs
indefinitely in of_scan_flat_dt().

Signed-off-by: Tobias Wolf <dev-NTEO@xxxxxxxxx>
---
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -628,6 +628,9 @@
 				     void *data),
 			   void *data)
 {
+	if (!initial_boot_params)
+		return 0;
+
 	const void *blob = initial_boot_params;
 	const char *pathp;
 	int offset, rc = 0, depth = -1;
---

Dear Sergei,

After checking the use of "of_scan_flat_dt()" I revised the patch to return 0
as any other value would most likely break code in:

It still causes a compiler warning -- you can't mix code and declarations in C90.

Best regards
Tobias

MBR, Sergei





[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux