Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 492ddc9 in mainline


Ignore:
Timestamp:
2012-02-09T22:15:46Z (10 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master
Children:
96d9cdd, bb6f135
Parents:
33ca0f5
Message:

Match km_page_free() size parameter in km_unmap_aligned() with that of
km_page_alloc() in km_map_aligned().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/mm/km.c

    r33ca0f5 r492ddc9  
    134134        ASSERT(ALIGN_UP(size, FRAME_SIZE) == size);
    135135
     136        /* Enforce natural or at least PAGE_SIZE alignment. */
    136137        align = ispwr2(size) ? size : (1U << (fnzb(size) + 1));
    137138        vaddr = km_page_alloc(size, max(PAGE_SIZE, align));
     
    150151{
    151152        uintptr_t offs;
     153        size_t align;
    152154        ipl_t ipl;
    153155
     
    168170        page_table_unlock(AS_KERNEL, true);
    169171
    170         km_page_free(vaddr, size);
     172        /*
     173         * Match the size parameter with that of km_page_alloc() in
     174         * km_map_aligned().
     175         */
     176        align = ispwr2(size) ? size : (1U << (fnzb(size) + 1));
     177        km_page_free(vaddr, max(PAGE_SIZE, align));
    171178}
    172179
Note: See TracChangeset for help on using the changeset viewer.