mirror of
https://github.com/mmueller41/genode.git
synced 2026-01-21 12:32:56 +01: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:
committed by
Christian Helmuth
parent
df5cadc8ad
commit
3b0995cb49
@@ -177,7 +177,11 @@ void Session_component::release_device(Capability<Platform::Device_interface> de
|
|||||||
Genode::Ram_dataspace_capability
|
Genode::Ram_dataspace_capability
|
||||||
Session_component::alloc_dma_buffer(size_t const size, Cache cache)
|
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;
|
if (!ram_cap.valid()) return ram_cap;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user