mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-22 06:57:51 +00:00
base: avoid null pointer warnings
warning: Called C++ object pointer is null Issue #3022
This commit is contained in:
parent
17f7147ac1
commit
fc0dbc3f70
@ -512,8 +512,13 @@ void Region_map_component::detach(Local_addr local_addr)
|
|||||||
"the beginning of the region ", Hex(region_ptr->base()));
|
"the beginning of the region ", Hex(region_ptr->base()));
|
||||||
|
|
||||||
Dataspace_component *dsc = region_ptr->dataspace();
|
Dataspace_component *dsc = region_ptr->dataspace();
|
||||||
if (!dsc && _diag.enabled)
|
|
||||||
warning("detach: region of ", this, " may be inconsistent!");
|
if (!dsc) {
|
||||||
|
if (_diag.enabled)
|
||||||
|
warning("detach: region of ", this, " may be inconsistent!");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* inform dataspace about detachment */
|
/* inform dataspace about detachment */
|
||||||
dsc->detached_from(region_ptr);
|
dsc->detached_from(region_ptr);
|
||||||
|
@ -49,6 +49,11 @@ void Avl_node_base::_rotate_subtree(Avl_node_base *node, Side side, Policy &poli
|
|||||||
Avl_node_base *node_r = node->_child[!side];
|
Avl_node_base *node_r = node->_child[!side];
|
||||||
Avl_node_base *node_r_l = node_r->_child[side];
|
Avl_node_base *node_r_l = node_r->_child[side];
|
||||||
|
|
||||||
|
if (!node_r) {
|
||||||
|
error("avl rotation node_r is invalid");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* simple rotation */
|
/* simple rotation */
|
||||||
if (node_r->_bias() == !side) {
|
if (node_r->_bias() == !side) {
|
||||||
|
|
||||||
|
@ -98,7 +98,8 @@ void Cancelable_lock::lock()
|
|||||||
if (!applicants)
|
if (!applicants)
|
||||||
_last_applicant = &myself;
|
_last_applicant = &myself;
|
||||||
} else {
|
} else {
|
||||||
_last_applicant->applicant_to_wake_up(&myself);
|
if (_last_applicant)
|
||||||
|
_last_applicant->applicant_to_wake_up(&myself);
|
||||||
_last_applicant = &myself;
|
_last_applicant = &myself;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user