mirror of
https://github.com/ipxe/ipxe
synced 2025-12-21 20:40:25 +03:00
[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>
This commit is contained in:
@@ -2113,6 +2113,7 @@ static int hermon_map_vpm ( struct hermon *hermon,
|
|||||||
assert ( ( va & ( HERMON_PAGE_SIZE - 1 ) ) == 0 );
|
assert ( ( va & ( HERMON_PAGE_SIZE - 1 ) ) == 0 );
|
||||||
assert ( ( pa & ( HERMON_PAGE_SIZE - 1 ) ) == 0 );
|
assert ( ( pa & ( HERMON_PAGE_SIZE - 1 ) ) == 0 );
|
||||||
assert ( ( len & ( HERMON_PAGE_SIZE - 1 ) ) == 0 );
|
assert ( ( len & ( HERMON_PAGE_SIZE - 1 ) ) == 0 );
|
||||||
|
assert ( len != 0 );
|
||||||
|
|
||||||
/* Calculate starting points */
|
/* Calculate starting points */
|
||||||
start = pa;
|
start = pa;
|
||||||
|
|||||||
Reference in New Issue
Block a user