summaryrefslogtreecommitdiff
path: root/include/linux
diff options
context:
space:
mode:
authorStephen Warren <[email protected]>2015-09-25 10:11:41 -0600
committerSimon Glass <[email protected]>2015-10-03 14:39:19 +0100
commitd93b9a0709e014557499208e05e2a9c451a5436b (patch)
tree328745a30c66bcf2663795c2a173d5a682585192 /include/linux
parent3d3f60cb7a6bb6c338e00a9769fa918a8536096c (diff)
fdt: fix fdtdec_get_addr_size not to require any size cells
fdtdec_get_addr_size() may be used in two cases: a) With sizep supplied, in which case both an address and a size are parsed from DT. In this case, the DT property must be large enough to contain both values. b) With sizep NULL, in which case only an address is parsed from DT. In this case, the DT property only need be large enough to contain this address value. Commit 02464e386bb5 "fdt: add new fdt address parsing functions" broke this relaxed checking, and required the DT property to contain both an address and a size value in all cases. Fix fdtdec_get_addr_size() to vary ns based on whether the size value is being parsed from the DT or not. This is safe since the function only parses the first entry in the property, so the overall value of (na + ns) need not be accurate, since it is never used to step through the property data to find other entries. Besides, this fixed behaviour essentially matches the original behaviour before the patch this patch fixes. (The original code validated that the property was exactly the length of either na or (na + ns), whereas the current code only validates that the property is at least that long. For non-failure cases, the two behaviours are identical). Cc: Przemyslaw Marczak <[email protected]> Cc: Simon Glass <[email protected]> Cc: Thierry Reding <[email protected]> Cc: Bin Meng <[email protected]> Cc: Michal Suchanek <[email protected]> Fixes: 02464e386bb5 ("fdt: add new fdt address parsing functions") Reported-by: Przemyslaw Marczak <[email protected]> Signed-off-by: Stephen Warren <[email protected]> Tested-by: Przemyslaw Marczak <[email protected]> Acked-by: Simon Glass <[email protected]>
Diffstat (limited to 'include/linux')
0 files changed, 0 insertions, 0 deletions