Skip to content
Snippets Groups Projects
Forked from Reform / reform-boundary-uboot
Source project has a limited visibility.
  • Hannes Schmelzer's avatar
    cee8c35d
    fdt: fix 'prop (...) not found!' error in 'fdt set' command · cee8c35d
    Hannes Schmelzer authored
    
    This commit brings things back to the well known working state of the
    command.
    -
    With commit 9620d872
    (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 99bb38e2
    (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: default avatarHannes Schmelzer <oe5hpm@oevsv.at>
    Acked-by: default avatarSimon Glass <sjg@chromium.org>
    cee8c35d
    History
    fdt: fix 'prop (...) not found!' error in 'fdt set' command
    Hannes Schmelzer authored
    
    This commit brings things back to the well known working state of the
    command.
    -
    With commit 9620d872
    (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 99bb38e2
    (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: default avatarHannes Schmelzer <oe5hpm@oevsv.at>
    Acked-by: default avatarSimon Glass <sjg@chromium.org>