mirror of
https://github.com/dgibson/dtc.git
synced 2025-10-13 16:27:39 -04:00
tests: Make realloc_fdt() really allocate *fdt
This bug has been found by using clang Static Analyzer: it reported that the value stored to fdt was never read. Signed-off-by: Nicolas Iooss <nicolas.iooss_linux@m4x.org> Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
921cc17fec
commit
d922ecdd01
1 changed files with 2 additions and 2 deletions
|
@ -42,14 +42,14 @@ static void realloc_fdt(void **fdt, size_t *size, bool created)
|
|||
switch (alloc_mode) {
|
||||
case FIXED:
|
||||
if (!(*fdt))
|
||||
fdt = xmalloc(*size);
|
||||
*fdt = xmalloc(*size);
|
||||
else
|
||||
FAIL("Ran out of space");
|
||||
return;
|
||||
|
||||
case RESIZE:
|
||||
if (!(*fdt)) {
|
||||
fdt = xmalloc(SPACE);
|
||||
*fdt = xmalloc(SPACE);
|
||||
} else if (*size < SPACE) {
|
||||
*size += 1;
|
||||
fdt_resize(*fdt, *fdt, *size);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue