mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-16 10:20:30 +00:00
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:
parent
1a26db0a3a
commit
04f0ce213f
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=166932
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user