Cleanup failure handling around rust_new_task_in_sched - closes #2668

This commit is contained in:
Ben Blum
2012-06-28 19:01:55 -04:00
parent d91e310982
commit 6fc730baf6
5 changed files with 9 additions and 3 deletions

View File

@@ -121,7 +121,9 @@ rust_kernel::get_scheduler_by_id(rust_sched_id id) {
rust_scheduler *
rust_kernel::get_scheduler_by_id_nolock(rust_sched_id id) {
assert(id != 0 && "invalid scheduler id");
if (id == 0) {
return NULL;
}
sched_lock.must_have_lock();
sched_map::iterator iter = sched_table.find(id);
if (iter != sched_table.end()) {