dtc: fdtdump: check fdt if not in scanning mode

Running fdtdump without scan mode for an invalid file often
results in a segmentation fault because the fdt header is
not checked.

With the patch the header is checked both in scanning as
well as in non-scanning mode.

Signed-off-by: Heinrich Schuchardt <[email protected]>
Signed-off-by: David Gibson <[email protected]>
[dwg: Removed unnecessary inline, changed type from int to bool]
Reviewed-by: Simon Glass <[email protected]>
1 file changed