DragonFlyBSD Kernel Audit
DF-0052 / fix.diff
← back to finding ↓ download raw
diff --git a/sys/kern/subr_alist.c b/sys/kern/subr_alist.c
--- a/sys/kern/subr_alist.c
+++ b/sys/kern/subr_alist.c
@@ -437,6 +437,7 @@
 	if (start >= blk + ALIST_BMAP_RADIX)
 		return(ALIST_BLOCK_NONE);
 
+	int orig_start_le_blk = (start <= blk);
 	if (start > blk && start < blk + ALIST_BMAP_RADIX)
 		orig &= ~(((alist_bmap_t)1U << (start - blk)) - 1);
 
@@ -448,7 +449,7 @@
 	 * we have to take care of this case here.
 	 */
 	if (orig == 0) {
-		if (start <= blk)
+		if (orig_start_le_blk)
 			scan->bm_bighint = 0;
 		return(ALIST_BLOCK_NONE);
 	}
@@ -506,7 +507,7 @@
 	 * We couldn't allocate count in this subtree, update bighint
 	 * if we were able to check the entire node.
 	 */
-	if (start <= blk)
+	if (orig_start_le_blk)
 		scan->bm_bighint = count - 1;
 	return(ALIST_BLOCK_NONE);
 }