]> git.baikalelectronics.ru Git - uboot.git/commit
fdt: fix 'prop (...) not found!' error in 'fdt set' command
authorHannes Schmelzer <oe5hpm@oevsv.at>
Fri, 18 Aug 2017 12:41:14 +0000 (14:41 +0200)
committerSimon Glass <sjg@chromium.org>
Mon, 4 Sep 2017 08:10:06 +0000 (02:10 -0600)
commitb35cafccdc7a1ce66fc64c5a8b53227bf847c5fb
tree96fb5e9b82fb4b60d63027f65cb5919301ff9fcb
parent25a06c7382ee589236e1f9c9de8038548e723358
fdt: fix 'prop (...) not found!' error in 'fdt set' command

This commit brings things back to the well known working state of the
command.
-
With commit 286ae5c2fd8210409ba543d2cff3b2f769da3201
(cmd/fdt: support single value replacement within an array)

there was an error introduced modifying (inserting) a property to a
device-tree node.
fdt_getprop(...) returnes a len with -1 for a non-existing property, but
a memcpy with len -1 isn't a good idea and things went wrong (crash).
-
Some times later Tom did repair this
with commit 0f0304eb0cb2cd24eb2adcd16628f2cf47b17650
(fdt: Check for NULL return from fdt_getprop in 'fdt set')

This repairs the crash but the behaviour of the command isn't like
before, it makes it impossible to insert a property.
-

Signed-off-by: Hannes Schmelzer <oe5hpm@oevsv.at>
Acked-by: Simon Glass <sjg@chromium.org>
cmd/fdt.c