mirror of
https://github.com/linux-sunxi/u-boot-sunxi.git
synced 2024-02-12 11:16:03 +08:00
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>
This commit is contained in:

committed by
Tom Rini

parent
aaa4ba930c
commit
3cc566117e
@ -350,7 +350,7 @@ static int part_test_efi(struct blk_desc *dev_desc)
|
|||||||
static int set_protective_mbr(struct blk_desc *dev_desc)
|
static int set_protective_mbr(struct blk_desc *dev_desc)
|
||||||
{
|
{
|
||||||
/* Setup the Protective MBR */
|
/* 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));
|
memset(p_mbr, 0, sizeof(*p_mbr));
|
||||||
|
|
||||||
if (p_mbr == NULL) {
|
if (p_mbr == NULL) {
|
||||||
@ -931,7 +931,7 @@ static int is_gpt_valid(struct blk_desc *dev_desc, u64 lba,
|
|||||||
return 0;
|
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 */
|
/* Read MBR Header from device */
|
||||||
if (blk_dread(dev_desc, 0, 1, (ulong *)mbr) != 1) {
|
if (blk_dread(dev_desc, 0, 1, (ulong *)mbr) != 1) {
|
||||||
|
Reference in New Issue
Block a user