Pārlūkot izejas kodu

[arbel] Assert that mapping length is non-zero

An (impossible) mapping length of zero produces a negative bit shift,
which is technically undefined.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 7 gadus atpakaļ
vecāks
revīzija
0ced99e97c
1 mainītis faili ar 1 papildinājumiem un 0 dzēšanām
  1. 1
    0
      src/drivers/infiniband/arbel.c

+ 1
- 0
src/drivers/infiniband/arbel.c Parādīt failu

@@ -1972,6 +1972,7 @@ static int arbel_map_vpm ( struct arbel *arbel,
1972 1972
 	assert ( ( va & ( ARBEL_PAGE_SIZE - 1 ) ) == 0 );
1973 1973
 	assert ( ( pa & ( ARBEL_PAGE_SIZE - 1 ) ) == 0 );
1974 1974
 	assert ( ( len & ( ARBEL_PAGE_SIZE - 1 ) ) == 0 );
1975
+	assert ( len != 0 );
1975 1976
 
1976 1977
 	/* Calculate starting points */
1977 1978
 	start = pa;

Notiek ielāde…
Atcelt
Saglabāt