nova: check for valid platform_pd pointer

This commit is contained in:
Alexander Boettcher 2016-01-19 11:59:13 +01:00 committed by Christian Helmuth
parent 8e50464a1a
commit 7598f09295
1 changed files with 9 additions and 0 deletions

View File

@ -231,6 +231,11 @@ void Platform_thread::resume()
if (!is_worker()) {
uint8_t res;
do {
if (!_pd) {
PERR("protection domain undefined %s - resuming thread failed",
__PRETTY_FUNCTION__);
return;
}
res = create_sc(_sel_sc(), _pd->pd_sel(), _sel_ec(),
Qpd(Qpd::DEFAULT_QUANTUM, _priority));
} while (res == Nova::NOVA_PD_OOM && Nova::NOVA_OK == _pager->handle_oom());
@ -316,6 +321,10 @@ unsigned long Platform_thread::pager_object_badge() const
Weak_ptr<Address_space> Platform_thread::address_space()
{
if (!_pd) {
PERR("protection domain undefined %s", __PRETTY_FUNCTION__);
return Weak_ptr<Address_space>();
}
return _pd->Address_space::weak_ptr();
}