ARM: zImage: atags_to_fdt: Fix node names on added root nodes
authorRob Herring <robh@kernel.org>
Tue, 26 Jan 2021 02:39:05 +0000 (20:39 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 3 Feb 2021 22:28:44 +0000 (23:28 +0100)
commitfec7ae28d90572fdb61e0e032dcef604679e212d
tree29f2286050c3b6f4025e4495db1c66430718f425
parent69da790360f3e373c26050508654cb59985f7896
ARM: zImage: atags_to_fdt: Fix node names on added root nodes

commit 30596ae0547dbda469d31a2678d9072fb0a3fa27 upstream.

Commit 7536c7e03e74 ("of/fdt: Remove redundant kbasename function
call") exposed a bug creating DT nodes in the ATAGS to DT fixup code.
Non-existent nodes would mistaken get created with a leading '/'. The
problem was fdt_path_offset() takes a full path while creating a node
with fdt_add_subnode() takes just the basename.

Since this we only add root child nodes, we can just skip over the '/'.

Fixes: 7536c7e03e74 ("of/fdt: Remove redundant kbasename function call")
Reported-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Cc: Qi Zheng <arch0.zheng@gmail.com>
Cc: Russell King <linux@armlinux.org.uk>
Signed-off-by: Rob Herring <robh@kernel.org>
Tested-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Link: https://lore.kernel.org/r/20210126023905.1631161-1-robh@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/arm/boot/compressed/atags_to_fdt.c