mirror of
https://github.com/genodelabs/genode.git
synced 2025-02-21 10:01:57 +00:00
libdrm/lima: propagate allocation failure
Failed allocations were still denoted with a successful return value to the caller. This situation was triggered by artificial testing and has not been observed yet in practice. In case the 'LIMA_GEM_CREATE' I/O control fails Mesa will dereference invalid pointers anyway. Issue genodelabs/genode-allwinner#27.
This commit is contained in:
parent
602f9b5670
commit
d9e4d32374
@ -765,6 +765,7 @@ class Lima::Call
|
||||
_main_ctx->gpu().upgrade_ram(donate);
|
||||
});
|
||||
} catch (Gpu::Vram::Allocation_failed) {
|
||||
_va_alloc.free(va);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -776,14 +777,12 @@ class Lima::Call
|
||||
{
|
||||
::uint64_t const size = arg.size;
|
||||
|
||||
try {
|
||||
_alloc_buffer(size, [&](Vram const &b) {
|
||||
arg.handle = b.id().value;
|
||||
});
|
||||
return 0;
|
||||
} catch (...) {
|
||||
return -1;
|
||||
}
|
||||
bool result = false;
|
||||
_alloc_buffer(size, [&](Vram const &b) {
|
||||
arg.handle = b.id().value;
|
||||
result = true;
|
||||
});
|
||||
return result ? 0 : -1;
|
||||
}
|
||||
|
||||
int _drm_lima_gem_submit(drm_lima_gem_submit &arg)
|
||||
|
Loading…
x
Reference in New Issue
Block a user