* grub-core/kern/mm.c (grub_real_malloc): Use AND rather than MOD

for alignment.
This commit is contained in:
Vladimir Serbinenko 2013-11-08 09:43:26 +01:00
parent e2a6810069
commit c6b755df45
2 changed files with 6 additions and 1 deletions

View file

@ -194,7 +194,7 @@ grub_real_malloc (grub_mm_header_t *first, grub_size_t n, grub_size_t align)
{
grub_off_t extra;
extra = ((grub_addr_t) (p + 1) >> GRUB_MM_ALIGN_LOG2) % align;
extra = ((grub_addr_t) (p + 1) >> GRUB_MM_ALIGN_LOG2) & (align - 1);
if (extra)
extra = align - extra;