Kaynağa Gözat

[hermon] 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 yıl önce
ebeveyn
işleme
dea5b74475
1 değiştirilmiş dosya ile 1 ekleme ve 0 silme
  1. 1
    0
      src/drivers/infiniband/hermon.c

+ 1
- 0
src/drivers/infiniband/hermon.c Dosyayı Görüntüle

@@ -2113,6 +2113,7 @@ static int hermon_map_vpm ( struct hermon *hermon,
2113 2113
 	assert ( ( va & ( HERMON_PAGE_SIZE - 1 ) ) == 0 );
2114 2114
 	assert ( ( pa & ( HERMON_PAGE_SIZE - 1 ) ) == 0 );
2115 2115
 	assert ( ( len & ( HERMON_PAGE_SIZE - 1 ) ) == 0 );
2116
+	assert ( len != 0 );
2116 2117
 
2117 2118
 	/* Calculate starting points */
2118 2119
 	start = pa;

Loading…
İptal
Kaydet