summaryrefslogtreecommitdiffstats
path: root/src/drivers
diff options
context:
space:
mode:
authorMichael Brown2017-03-22 14:18:54 +0100
committerMichael Brown2017-03-22 14:20:14 +0100
commitdea5b744750f691c071b018b1084fa916ed630a8 (patch)
tree49ed4059365e69d6956f429c83c84a2c033f8886 /src/drivers
parent[arbel] Assert that mapping length is non-zero (diff)
downloadipxe-dea5b744750f691c071b018b1084fa916ed630a8.tar.gz
ipxe-dea5b744750f691c071b018b1084fa916ed630a8.tar.xz
ipxe-dea5b744750f691c071b018b1084fa916ed630a8.zip
[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')
-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 3797d96e..a1d2a3bd 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;