aboutsummaryrefslogtreecommitdiff
path: root/lib/test_overflow.c
diff options
context:
space:
mode:
authorPetr Pavlu <[email protected]>2021-08-07 19:54:50 +0200
committerPalmer Dabbelt <[email protected]>2021-08-20 10:15:51 -0700
commitaa3e1ba32e553e611a58145c2eb349802feaa6eb (patch)
tree38319ee9fca26c731a07ccbdc67ab2f527a0cd46 /lib/test_overflow.c
parent1c8094e394bceb4f1880f9d539bdd255c130826e (diff)
riscv: Fix a number of free'd resources in init_resources()
Function init_resources() allocates a boot memory block to hold an array of resources which it adds to iomem_resource. The array is filled in from its end and the function then attempts to free any unused memory at the beginning. The problem is that size of the unused memory is incorrectly calculated and this can result in releasing memory which is in use by active resources. Their data then gets corrupted later when the memory is reused by a different part of the system. Fix the size of the released memory to correctly match the number of unused resource entries. Fixes: ffe0e5261268 ("RISC-V: Improve init_resources()") Signed-off-by: Petr Pavlu <[email protected]> Reviewed-by: Sunil V L <[email protected]> Acked-by: Nick Kossifidis <[email protected]> Tested-by: Sunil V L <[email protected]> Cc: [email protected] Signed-off-by: Palmer Dabbelt <[email protected]>
Diffstat (limited to 'lib/test_overflow.c')
0 files changed, 0 insertions, 0 deletions