summaryrefslogtreecommitdiffstats
path: root/src/drivers/infiniband
diff options
context:
space:
mode:
authorMichael Brown2017-03-22 14:18:54 +0100
committerMichael Brown2017-03-22 14:18:54 +0100
commit0ced99e97c59e193eb7b1313fbb4473c720c59dc (patch)
tree8bef2e0c1c72c3f5a272a60a6a7dcba50d0f416e /src/drivers/infiniband
parent[video_subr] Use memmove() for overlapping memory copy (diff)
downloadipxe-0ced99e97c59e193eb7b1313fbb4473c720c59dc.tar.gz
ipxe-0ced99e97c59e193eb7b1313fbb4473c720c59dc.tar.xz
ipxe-0ced99e97c59e193eb7b1313fbb4473c720c59dc.zip
[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>
Diffstat (limited to 'src/drivers/infiniband')
-rw-r--r--src/drivers/infiniband/arbel.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/drivers/infiniband/arbel.c b/src/drivers/infiniband/arbel.c
index ea65d8b8..98a2b601 100644
--- a/src/drivers/infiniband/arbel.c
+++ b/src/drivers/infiniband/arbel.c
@@ -1972,6 +1972,7 @@ static int arbel_map_vpm ( struct arbel *arbel,
assert ( ( va & ( ARBEL_PAGE_SIZE - 1 ) ) == 0 );
assert ( ( pa & ( ARBEL_PAGE_SIZE - 1 ) ) == 0 );
assert ( ( len & ( ARBEL_PAGE_SIZE - 1 ) ) == 0 );
+ assert ( len != 0 );
/* Calculate starting points */
start = pa;