diff options
Diffstat (limited to 'lib/libfdt/fdt.c')
-rw-r--r-- | lib/libfdt/fdt.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/libfdt/fdt.c b/lib/libfdt/fdt.c index b09ea6f..4157b21 100644 --- a/lib/libfdt/fdt.c +++ b/lib/libfdt/fdt.c @@ -153,6 +153,15 @@ int _fdt_check_node_offset(const void *fdt, int offset) return offset; } +int _fdt_check_prop_offset(const void *fdt, int offset) +{ + if ((offset < 0) || (offset % FDT_TAGSIZE) + || (fdt_next_tag(fdt, offset, &offset) != FDT_PROP)) + return -FDT_ERR_BADOFFSET; + + return offset; +} + int fdt_next_node(const void *fdt, int offset, int *depth) { int nextoffset = 0; |