]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
Fix a mistake with size calculation
authorVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Thu, 14 Jan 2010 18:14:04 +0000 (19:14 +0100)
committerVladimir 'phcoder' Serbinenko <phcoder@gmail.com>
Thu, 14 Jan 2010 18:14:04 +0000 (19:14 +0100)
lib/relocator.c

index 090a6c7e37ab02d085c495a9c63f59a63452b279..b7fe404c38cc1267cb50f7c053d2aeb8077c4527 100644 (file)
@@ -308,12 +308,12 @@ malloc_in_range (struct grub_relocator *rel,
 
     if (best_addr - (grub_addr_t) hb >= sizeof (*hb))
       {
-       hb->size = (best_addr - (grub_addr_t) hb) >> GRUB_MM_ALIGN_LOG2;
+       hb->size = ((best_addr - (grub_addr_t) hb) >> GRUB_MM_ALIGN_LOG2) - 1;
        if (foll)
          {
            foll->next = hb;
            hbp->next = foll;
-           if (rb->first == hbp)
+           if (rb->first == hb)
              rb->first = foll;
          }
       }