X-Git-Url: http://ftp.safe.ca/?a=blobdiff_plain;f=fs%2Fpartitions%2Fefi.c;h=49cfd5f5423894df4c2f52ac48bac1f82a9b43a3;hb=9a3cbe3265c7714e8ee423feb6e27a080af79608;hp=80eeff5fdfe03f080147f797b0636511dbbe5d4a;hpb=7d13af3279985f554784a45cc961f706dbcdbdd1;p=safe%2Fjmp%2Flinux-2.6 diff --git a/fs/partitions/efi.c b/fs/partitions/efi.c index 80eeff5..49cfd5f 100644 --- a/fs/partitions/efi.c +++ b/fs/partitions/efi.c @@ -262,15 +262,16 @@ static gpt_header * alloc_read_gpt_header(struct block_device *bdev, u64 lba) { gpt_header *gpt; + unsigned ssz = bdev_logical_block_size(bdev); + if (!bdev) return NULL; - gpt = kzalloc(sizeof (gpt_header), GFP_KERNEL); + gpt = kzalloc(ssz, GFP_KERNEL); if (!gpt) return NULL; - if (read_lba(bdev, lba, (u8 *) gpt, - sizeof (gpt_header)) < sizeof (gpt_header)) { + if (read_lba(bdev, lba, (u8 *) gpt, ssz) < ssz) { kfree(gpt); gpt=NULL; return NULL;