ソースを参照

[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年前
コミット
0ced99e97c
1個のファイルの変更1行の追加0行の削除
  1. 1
    0
      src/drivers/infiniband/arbel.c

+ 1
- 0
src/drivers/infiniband/arbel.c ファイルの表示

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

読み込み中…
キャンセル
保存