]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[librm] Correct page table stride calculation
authorMichael Brown <mcb30@ipxe.org>
Mon, 27 Oct 2025 14:02:50 +0000 (14:02 +0000)
committerMichael Brown <mcb30@ipxe.org>
Mon, 27 Oct 2025 14:22:16 +0000 (14:22 +0000)
Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/arch/x86/transitions/librm_mgmt.c

index 77aecdb7d6122141ed4b20801f1c85443855ecb1..e51f0e6495d16b1796af9ffe4e847f4872f90e73 100644 (file)
@@ -307,7 +307,7 @@ static void * ioremap_pages ( unsigned long bus_addr, size_t len ) {
                           sizeof ( io_pages.page[0] ) ) );
 
        /* Round up number of pages to a power of two */
-       stride = ( 1 << ( fls ( count ) - 1 ) );
+       stride = ( 1 << fls ( count - 1 ) );
        assert ( count <= stride );
 
        /* Allocate pages */