fdtdump: Return an error code on wrong tag value

fdtdump prints a message on stderr when it encounters a wrong tag and
stop its processing without returning an error code.

Having a wrong tag is really a failure. Indeed, the processing cannot
continue.

Be more strict. Stop the processing, print a message and return an
error code. In other words, call die().

Signed-off-by: Herve Codina <herve.codina@bootlin.com>
Message-ID: <20260210173349.636766-4-herve.codina@bootlin.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
This commit is contained in:
Herve Codina 2026-02-10 18:33:31 +01:00 committed by David Gibson
parent 68b960e299
commit 5bb5bedd34

View file

@ -146,8 +146,7 @@ static void dump_blob(void *blob, bool debug)
continue;
}
fprintf(stderr, "%*s ** Unknown tag 0x%08"PRIx32"\n", depth * shift, "", tag);
break;
die("** Unknown tag 0x%08"PRIx32"\n", tag);
}
}