aboutsummaryrefslogtreecommitdiffstats
path: root/src/drivers/infiniband
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2017-03-22 15:18:54 +0200
committerMichael Brown <mcb30@ipxe.org>2017-03-22 15:20:14 +0200
commitdea5b744750f691c071b018b1084fa916ed630a8 (patch)
tree49ed4059365e69d6956f429c83c84a2c033f8886 /src/drivers/infiniband
parent0ced99e97c59e193eb7b1313fbb4473c720c59dc (diff)
downloadipxe-dea5b744750f691c071b018b1084fa916ed630a8.tar.gz
[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>
Diffstat (limited to 'src/drivers/infiniband')
-rw-r--r--src/drivers/infiniband/hermon.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/drivers/infiniband/hermon.c b/src/drivers/infiniband/hermon.c
index 3797d96e8..a1d2a3bd5 100644
--- a/src/drivers/infiniband/hermon.c
+++ b/src/drivers/infiniband/hermon.c
@@ -2113,6 +2113,7 @@ static int hermon_map_vpm ( struct hermon *hermon,
assert ( ( va & ( HERMON_PAGE_SIZE - 1 ) ) == 0 );
assert ( ( pa & ( HERMON_PAGE_SIZE - 1 ) ) == 0 );
assert ( ( len & ( HERMON_PAGE_SIZE - 1 ) ) == 0 );
+ assert ( len != 0 );
/* Calculate starting points */
start = pa;