tests: Remove valgrind error from tests/get_path
In the case where fdt_get_path() returns an error, a debug print will attempt to display a poisoned buffer, running over the end and accessing uninitialized memory. Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
parent
df536831d0
commit
02c5fe9deb
1 changed files with 2 additions and 1 deletions
|
@ -42,7 +42,8 @@ static void check_path_buf(void *fdt, const char *path, int pathlen, int buflen)
|
|||
memset(buf, POISON, sizeof(buf)); /* poison the buffer */
|
||||
|
||||
len = fdt_get_path(fdt, offset, buf, buflen);
|
||||
verbose_printf("get_path() %s -> %d -> %s\n", path, offset, buf);
|
||||
verbose_printf("get_path() %s -> %d -> %s\n", path, offset,
|
||||
len >= 0 ? buf : "<error>");
|
||||
|
||||
if (buflen <= pathlen) {
|
||||
if (len != -FDT_ERR_NOSPACE)
|
||||
|
|
Loading…
Reference in a new issue