mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-08 11:55:24 +00:00
base-nova: fix map for small sizes
Changes to the platform driver triggered a map() error while mapping an address block at 0x3000 of size 0x800. Since the mapped size was larger, the loop continued and tried mapping address 0x4000 where no dataspace was found. genodelabs/genode#4761
This commit is contained in:
parent
cb0546aa9b
commit
d3d3351b99
@ -99,7 +99,7 @@ void Pd_session_component::map(addr_t virt, addr_t size)
|
||||
while (size) {
|
||||
addr_t mapped = _address_space.apply_to_dataspace(virt, lambda);
|
||||
virt += mapped;
|
||||
size = size < mapped ? size : size - mapped;
|
||||
size = size < mapped ? 0 : size - mapped;
|
||||
}
|
||||
} catch (...) {
|
||||
error(__func__, " failed ", Hex(virt), "+", Hex(size));
|
||||
|
Loading…
x
Reference in New Issue
Block a user