summaryrefslogtreecommitdiff
path: root/disk
diff options
context:
space:
mode:
authorPatrick Delaunay <patrick.delaunay@st.com>2017-11-17 10:08:18 +0100
committerTom Rini <trini@konsulko.com>2017-11-29 22:30:50 -0500
commit3cc566117e18f5b3fe3e79a593bee32703f83192 (patch)
treee9e7a18cb5459cbe90c8a5a573ed361ad6fa8eb1 /disk
parentaaa4ba930ca3bbc98f33651b175480ba86aa4dd2 (diff)
disk: efi: correct the allocation size for mbr header in stack
use ALLOC_CACHE_ALIGN_BUFFER_PAD for mbr header allocation in stack to fix alloc issue in is_gpt_valid() this patch fix also issue for GPT partition handling with blocksize != 512 in set_protective_mbr() Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Diffstat (limited to 'disk')
-rw-r--r--disk/part_efi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/disk/part_efi.c b/disk/part_efi.c
index f6f5bee8cd..bea8b20bbd 100644
--- a/disk/part_efi.c
+++ b/disk/part_efi.c
@@ -350,7 +350,7 @@ static int part_test_efi(struct blk_desc *dev_desc)
static int set_protective_mbr(struct blk_desc *dev_desc)
{
/* Setup the Protective MBR */
- ALLOC_CACHE_ALIGN_BUFFER(legacy_mbr, p_mbr, 1);
+ ALLOC_CACHE_ALIGN_BUFFER_PAD(legacy_mbr, p_mbr, 1, dev_desc->blksz);
memset(p_mbr, 0, sizeof(*p_mbr));
if (p_mbr == NULL) {
@@ -931,7 +931,7 @@ static int is_gpt_valid(struct blk_desc *dev_desc, u64 lba,
return 0;
}
- ALLOC_CACHE_ALIGN_BUFFER(legacy_mbr, mbr, dev_desc->blksz);
+ ALLOC_CACHE_ALIGN_BUFFER_PAD(legacy_mbr, mbr, 1, dev_desc->blksz);
/* Read MBR Header from device */
if (blk_dread(dev_desc, 0, 1, (ulong *)mbr) != 1) {