Browse Source

[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 years ago
parent
commit
0ced99e97c
1 changed files with 1 additions and 0 deletions
  1. 1
    0
      src/drivers/infiniband/arbel.c

+ 1
- 0
src/drivers/infiniband/arbel.c View File

@@ -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;

Loading…
Cancel
Save