kernel: Store "next" pointer before notifying B_EVENT_INVALID.
Once B_EVENT_INVALID has been set, the select routine is free to delete the select_info at any time. We therefore cannot access the "next" pointer after notify_select_events returns. May fix a KDL seen by trungnt2910.
This commit is contained in:
@@ -745,8 +745,9 @@ notify_select_events_list(select_info* list, uint16 events)
|
|||||||
{
|
{
|
||||||
struct select_info* info = list;
|
struct select_info* info = list;
|
||||||
while (info != NULL) {
|
while (info != NULL) {
|
||||||
|
select_info* next = info->next;
|
||||||
notify_select_events(info, events);
|
notify_select_events(info, events);
|
||||||
info = info->next;
|
info = next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -556,8 +556,9 @@ deselect_select_infos(file_descriptor* descriptor, select_info* infos,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
select_info* next = info->next;
|
||||||
notify_select_events(info, B_EVENT_INVALID);
|
notify_select_events(info, B_EVENT_INVALID);
|
||||||
info = info->next;
|
info = next;
|
||||||
|
|
||||||
if (putSyncObjects)
|
if (putSyncObjects)
|
||||||
put_select_sync(sync);
|
put_select_sync(sync);
|
||||||
|
|||||||
@@ -2242,9 +2242,10 @@ thread_exit(void)
|
|||||||
while (info != NULL) {
|
while (info != NULL) {
|
||||||
select_sync* sync = info->sync;
|
select_sync* sync = info->sync;
|
||||||
|
|
||||||
|
select_info* next = info->next;
|
||||||
notify_select_events(info, B_EVENT_INVALID);
|
notify_select_events(info, B_EVENT_INVALID);
|
||||||
info = info->next;
|
|
||||||
put_select_sync(sync);
|
put_select_sync(sync);
|
||||||
|
info = next;
|
||||||
}
|
}
|
||||||
|
|
||||||
// notify listeners
|
// notify listeners
|
||||||
|
|||||||
Reference in New Issue
Block a user