This fixes a bug in the iommu allocator that causes it to behave
strangely when a fair size of the table is allocated.
Thanks to Andrew Gallatin for finding this.
end = n + npages;
if (unlikely(end >= limit)) {
- if (likely(pass++ < 2)) {
+ if (likely(pass < 2)) {
/* First failure, just rescan the half of the table.
* Second failure, rescan the other half of the table.
*/
start = (largealloc ^ pass) ? tbl->it_halfpoint : 0;
limit = pass ? tbl->it_mapsize : limit;
+ pass++;
goto again;
} else {
/* Third failure, give up */