Skip to content
Snippets Groups Projects
  • Patrick Delaunay's avatar
    dae188e6
    tools: ftdgrep: correct the find regions loop in do_fdtgrep · dae188e6
    Patrick Delaunay authored
    
    Use realloc and update the loop executed in do_fdtgrep to find all
    the regions: only test count > max_region after the second pass.
    
    This patch solve an issue if the number of region found (count)
    is greater then the default value (max_region = count = 100):
    the second pass is never executed, because the loop stops after
    the first pass (i = 0, count > 100, max_regions = 100)
    with error -1 and the error message
    "Internal error with fdtgrep_find_region".
    
    I also update the error message.
    
    Signed-off-by: default avatarPatrick Delaunay <patrick.delaunay@st.com>
    dae188e6
    History
    tools: ftdgrep: correct the find regions loop in do_fdtgrep
    Patrick Delaunay authored
    
    Use realloc and update the loop executed in do_fdtgrep to find all
    the regions: only test count > max_region after the second pass.
    
    This patch solve an issue if the number of region found (count)
    is greater then the default value (max_region = count = 100):
    the second pass is never executed, because the loop stops after
    the first pass (i = 0, count > 100, max_regions = 100)
    with error -1 and the error message
    "Internal error with fdtgrep_find_region".
    
    I also update the error message.
    
    Signed-off-by: default avatarPatrick Delaunay <patrick.delaunay@st.com>
fdtgrep.c 30.75 KiB