mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-19 21:57:55 +00:00
platform_drv: fix uncaught exception
Calling alloc_dma_buffer() with size=0 will cause an exception in the ram allocator. genodelabs/genode#4518
This commit is contained in:
parent
df5cadc8ad
commit
3b0995cb49
@ -177,7 +177,11 @@ void Session_component::release_device(Capability<Platform::Device_interface> de
|
||||
Genode::Ram_dataspace_capability
|
||||
Session_component::alloc_dma_buffer(size_t const size, Cache cache)
|
||||
{
|
||||
Ram_dataspace_capability ram_cap = _env_ram.alloc(size, cache);
|
||||
Ram_dataspace_capability ram_cap { };
|
||||
|
||||
try {
|
||||
ram_cap = _env_ram.alloc(size, cache);
|
||||
} catch (Ram_allocator::Denied) { }
|
||||
|
||||
if (!ram_cap.valid()) return ram_cap;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user