mirror of
https://github.com/genodelabs/genode.git
synced 2025-01-31 08:25:38 +00:00
platform_drv(x86): avoid exception in alloc_dma
If size is zero, the platform goes out of service by: [init -> platform_drv] Error: Uncaught exception of type 'Genode::Ram_allocator::Denied' [init -> platform_drv] Warning: abort called - thread: e Issue #4450
This commit is contained in:
parent
dd10e5d977
commit
a222df31ba
@ -835,6 +835,9 @@ class Platform::Session_component : public Rpc_object<Session>
|
||||
if (_env.pd().avail_ram().value < WATERMARK_RAM_QUOTA)
|
||||
throw Out_of_ram();
|
||||
|
||||
if (!size)
|
||||
return {};
|
||||
|
||||
Ram_dataspace_capability ram_cap = _env_ram.alloc(size, cache);
|
||||
addr_t const dma_addr = _env.pd().dma_addr(ram_cap);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user