1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 07:28:11 +00:00

Kernel: Fix regression, removing a ProcessGroup that not in the list

I introduced this bug in e95eb7a51, where it's possible that the
ProcessGroup is created, but we never add it to the list. Make sure we
check that we are in the list before removal. This only broke booting in
self-test mode oddly enough.

Reported-By: Andrew Kaster <andrewdkaster@gmail.com>
This commit is contained in:
Brian Gianforcaro 2021-05-20 00:30:47 -07:00 committed by Andreas Kling
parent cdb93e9307
commit bbe315d8c0

View file

@ -14,7 +14,9 @@ InlineLinkedList<ProcessGroup>* g_process_groups;
ProcessGroup::~ProcessGroup()
{
ScopedSpinLock lock(g_process_groups_lock);
g_process_groups->remove(this);
if (m_next || m_prev) {
g_process_groups->remove(this);
}
}
RefPtr<ProcessGroup> ProcessGroup::create(ProcessGroupID pgid)