From: Jason Gunthorpe Date: Sat, 27 Mar 2010 04:09:56 +0000 (-0600) Subject: of/flattree: Fix unhandled OF_DT_NOP tag when unflattening the device tree X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7f809e1f8e2f46c486bfe529579a16a28daacd62;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git of/flattree: Fix unhandled OF_DT_NOP tag when unflattening the device tree NOPs within the property section are skipped, but NOPs between OF_DT_END_NODE and OF_DT_BEGIN_NODE were not. My firmware NOPs out entire nodes depending on various environment parameters. of_scan_flat_dt already handles NOP more generally. Signed-off-by: Jason Gunthorpe Signed-off-by: Grant Likely --- diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c index 406757a9d7ea..dee4fb56b094 100644 --- a/drivers/of/fdt.c +++ b/drivers/of/fdt.c @@ -376,8 +376,11 @@ unsigned long __init unflatten_dt_node(unsigned long mem, if (!np->type) np->type = ""; } - while (tag == OF_DT_BEGIN_NODE) { - mem = unflatten_dt_node(mem, p, np, allnextpp, fpsize); + while (tag == OF_DT_BEGIN_NODE || tag == OF_DT_NOP) { + if (tag == OF_DT_NOP) + *p += 4; + else + mem = unflatten_dt_node(mem, p, np, allnextpp, fpsize); tag = be32_to_cpup((__be32 *)(*p)); } if (tag != OF_DT_END_NODE) {