Skip to content

Commit 714aed1

Browse files
committed
added a KASSERT, just to be sure.
1 parent de8a5c2 commit 714aed1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

sys/external/bsd/drm2/dist/drm/i915/gt/intel_ggtt.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,12 +282,13 @@ static void gen8_ggtt_insert_entries(struct i915_address_space *vm,
282282
gen8_set_pte(ggtt->gsmt, ggtt->gsmh, pgno++,
283283
pte_encode | addr);
284284
}
285+
KASSERT(len == 0);
285286
/* Fill the allocated but "unused" space beyond the end of the buffer */
286-
for (;pgno<pgend;pgno++,len--)
287+
KASSERT(pgno <= pgend);
288+
for (;pgno<pgend;pgno++)
287289
{
288290
gen8_set_pte(ggtt->gsmt + pgno, vm->scratch[0].encode);
289291
}
290-
KASSERT(len == 0);
291292
}
292293
#else
293294
gte = (gen8_pte_t __iomem *)ggtt->gsm;

0 commit comments

Comments
 (0)