Devicetree
 help / color / mirror / Atom feed
From: Sascha Silbe <x-linux@infra-silbe.de>
To: Rob Herring <robh+dt@kernel.org>, Frank Rowand <frowand.list@gmail.com>
Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 2/2] of: fdt: fix unflattening of FDTs containing uncompressed paths
Date: Sat, 13 May 2017 12:22:29 +0200	[thread overview]
Message-ID: <20170513102229.22579-3-x-linux@infra-silbe.de> (raw)
In-Reply-To: <20170513102229.22579-1-x-linux@infra-silbe.de>

Probably since commit dfbd4c6eff35 ("drivers/of: Split
unflatten_dt_node()"), unflattening an FDT containing uncompressed
node names (e.g. "/gpio@d4019000/gpio@0") will abort after scanning
the root node because fpsize wasn't updated to include the path len.

Signed-off-by: Sascha Silbe <x-linux@infra-silbe.de>
---
 drivers/of/fdt.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/of/fdt.c b/drivers/of/fdt.c
index e5ce4b59e162..2d5414e644b3 100644
--- a/drivers/of/fdt.c
+++ b/drivers/of/fdt.c
@@ -309,6 +309,8 @@ static unsigned int populate_node(const void *blob,
 			fpsize += l;
 			allocl = fpsize;
 		}
+	} else {
+		fpsize += allocl;
 	}
 
 	np = unflatten_dt_alloc(mem, sizeof(struct device_node) + allocl,
-- 
2.11.0

      parent reply	other threads:[~2017-05-13 10:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-13 10:22 [PATCH 0/2] FDT fixes for running on native Open Firmware Sascha Silbe
2017-05-13 10:22 ` [PATCH 1/2] fdt: correctly handle uncompressed node names Sascha Silbe
     [not found]   ` <20170513102229.22579-2-x-linux-XAdK+dDVA0n/cwiKa4OQEw@public.gmane.org>
2017-05-13 12:35     ` kbuild test robot
2017-05-13 13:07     ` kbuild test robot
2017-05-15 15:19   ` Rob Herring
2017-05-13 10:22 ` Sascha Silbe [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170513102229.22579-3-x-linux@infra-silbe.de \
    --to=x-linux@infra-silbe.de \
    --cc=devicetree@vger.kernel.org \
    --cc=frowand.list@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox