[hermon] Avoid potential integer overflow when calculating memory mappings
authorMichael Brown <mcb30@ipxe.org>
Tue, 21 Mar 2017 09:46:17 +0000 (11:46 +0200)
committerMichael Brown <mcb30@ipxe.org>
Tue, 21 Mar 2017 10:01:51 +0000 (12:01 +0200)
commit6ee62eb24220d8e364728c007f0d6cb8285e544a
tree13135a1c0ae9efa5e279c45ad053aaa896ca6e22
parentde2c6fa240fc3b42c91c06775de6a26eb4aa3faf
[hermon] Avoid potential integer overflow when calculating memory mappings

When the area to be mapped straddles the 2GB boundary, the expression
(high+size) will overflow on the first loop iteration.  Fix by using
(end-size), which cannot underflow.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/drivers/infiniband/hermon.c