mirror of
https://github.com/genodelabs/genode.git
synced 2025-02-21 02:01:38 +00:00
Fiasco.OC: only access valid UTCB (fix #547)
If no platform thread was created before somebody destroys a thread object, there is no valid UTCB available. Thereby, we've to check this before accessing the UTCB when destroying a thread object.
This commit is contained in:
parent
bec35bb4b1
commit
bc38a13353
@ -29,9 +29,11 @@ void Thread_base::_deinit_platform_thread()
|
||||
{
|
||||
using namespace Fiasco;
|
||||
|
||||
Cap_index *i = (Cap_index*)l4_utcb_tcr_u(_context->utcb)->user[UTCB_TCR_BADGE];
|
||||
cap_map()->remove(i);
|
||||
env()->cpu_session()->kill_thread(_thread_cap);
|
||||
if (_context->utcb && _thread_cap.valid()) {
|
||||
Cap_index *i = (Cap_index*)l4_utcb_tcr_u(_context->utcb)->user[UTCB_TCR_BADGE];
|
||||
cap_map()->remove(i);
|
||||
env()->cpu_session()->kill_thread(_thread_cap);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user