Fix a case in rman_manage_region() where the resource list would get missorted.

This would in turn confuse rman_reserve_resource().  This was only seen for
MSI resources that can get allocated and deallocated after boot.
This commit is contained in:
Scott Long 2007-02-23 22:53:56 +00:00
parent 1a26db0a3a
commit 04f0ce213f
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=166932

View File

@ -209,13 +209,14 @@ rman_manage_region(struct rman *rm, u_long start, u_long end)
s->r_end = r->r_end;
free(r, M_RMAN);
}
} else {
} else if (t != NULL) {
/* Can we merge with just the next region? */
if (t != NULL) {
t->r_start = r->r_start;
free(r, M_RMAN);
} else
TAILQ_INSERT_BEFORE(s, r, r_link);
t->r_start = r->r_start;
free(r, M_RMAN);
} else if (s->r_end < r->r_start) {
TAILQ_INSERT_AFTER(&rm->rm_list, s, r, r_link);
} else {
TAILQ_INSERT_BEFORE(s, r, r_link);
}
}