aboutsummaryrefslogtreecommitdiffstats
path: root/disk
diff options
context:
space:
mode:
authorAlexey Brodkin2018-01-29 13:58:24 -0600
committerTom Rini2018-02-07 21:06:17 -0600
commit8639e34d2c5e12cc2e45c95b1a2e97c22bf6a711 (patch)
tree5530c592a371ab178ce6ab64df813623bfbbd941 /disk
parent6808ef9ac2a66a261bf341a99c3edb1e69f1cbdd (diff)
downloadu-boot-8639e34d2c5e12cc2e45c95b1a2e97c22bf6a711.tar.gz
u-boot-8639e34d2c5e12cc2e45c95b1a2e97c22bf6a711.tar.xz
u-boot-8639e34d2c5e12cc2e45c95b1a2e97c22bf6a711.zip
part: Allocate only one legacy_mbr buffer
Commit ff98cb90514d ("part: extract MBR signature from partitions") blindly switched allocated by ALLOC_CACHE_ALIGN_BUFFER buffer type from "unsigned char" to "legacy_mbr" which caused allocation of size = (typeof(legacy_mbr) * dev_desc->blksize) instead of just space enough for "legacy_mbr" structure. Signed-off-by: Alexey Brodkin <abrodkin@synopsys.com> Cc: Rob Clark <robdclark@gmail.com> Cc: Peter Jones <pjones@redhat.com> Cc: Alexander Graf <agraf@suse.de> Cc: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'disk')
-rw-r--r--disk/part_dos.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/disk/part_dos.c b/disk/part_dos.c
index 046f9bbb3d..9dd086d3db 100644
--- a/disk/part_dos.c
+++ b/disk/part_dos.c
@@ -90,7 +90,7 @@ static int test_block_type(unsigned char *buffer)
90static int part_test_dos(struct blk_desc *dev_desc) 90static int part_test_dos(struct blk_desc *dev_desc)
91{ 91{
92#ifndef CONFIG_SPL_BUILD 92#ifndef CONFIG_SPL_BUILD
93 ALLOC_CACHE_ALIGN_BUFFER(legacy_mbr, mbr, dev_desc->blksz); 93 ALLOC_CACHE_ALIGN_BUFFER(legacy_mbr, mbr, 1);
94 94
95 if (blk_dread(dev_desc, 0, 1, (ulong *)mbr) != 1) 95 if (blk_dread(dev_desc, 0, 1, (ulong *)mbr) != 1)
96 return -1; 96 return -1;