Bugfix urpc should handle a missing cap

This commit is contained in:
Sparchatus 2022-05-05 08:32:24 +00:00
parent 2751ed3a15
commit 80313640f4

View File

@ -68,10 +68,14 @@ errval_t do_aos_urpc(
if (ret0 != NULL) *ret0 = rpc->meta->a2;
if (ret1 != NULL) *ret1 = rpc->meta->a3;
if(ret_cap != NULL && rpc->meta->cap.type != ObjType_Null) {
assert(rpc->meta->cap.type == ObjType_RAM);
err = ram_forge(*ret_cap, rpc->meta->cap.u.ram.base, rpc->meta->cap.u.ram.bytes, my_core_id);
if (err_is_fail(err)) return err;
if(ret_cap != NULL) {
if(rpc->meta->cap.type != ObjType_Null) {
assert(rpc->meta->cap.type == ObjType_RAM);
err = ram_forge(*ret_cap, rpc->meta->cap.u.ram.base, rpc->meta->cap.u.ram.bytes, my_core_id);
if (err_is_fail(err)) return err;
} else {
*ret_cap = NULL_CAP;
}
}
return rpc->meta->a0;