* grub-core/kern/disk.c (grub_disk_read): Fix hook calling for

unaligned segments.
This commit is contained in:
Vladimir 'phcoder' Serbinenko 2011-12-24 02:43:21 +01:00
parent 9197b0ade5
commit 379586ad7d
2 changed files with 11 additions and 5 deletions

View file

@ -1,3 +1,8 @@
2011-12-24 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/kern/disk.c (grub_disk_read): Fix hook calling for
unaligned segments.
2011-12-24 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/disk/ieee1275/ofdisk.c (grub_ofdisk_iterate): Add ieee1275/

View file

@ -607,12 +607,13 @@ grub_disk_read (grub_disk_t disk, grub_disk_addr_t sector,
while (l)
{
(disk->read_hook) (s, o,
((l > GRUB_DISK_SECTOR_SIZE)
? GRUB_DISK_SECTOR_SIZE
: l));
grub_size_t cl;
cl = GRUB_DISK_SECTOR_SIZE - o;
if (cl > l)
cl = l;
(disk->read_hook) (s, o, cl);
s++;
l -= GRUB_DISK_SECTOR_SIZE - o;
l -= cl;
o = 0;
}
}