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:
Nicolas Iooss 2017-03-04 14:26:45 +01:00 committed by David Gibson
parent 921cc17fec
commit d922ecdd01

View file

@ -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);