public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] disk: part_efi: fix regression due to incorrect buffer usage
@ 2011-10-28 19:21 Stephen Warren
  2011-10-28 19:43 ` Doug Anderson
  2011-10-30 15:44 ` Mike Frysinger
  0 siblings, 2 replies; 12+ messages in thread
From: Stephen Warren @ 2011-10-28 19:21 UTC (permalink / raw)
  To: u-boot

Commit deb5ca80275e8cfa74d5680b41204e08a095eca5 "disk: part_efi: fix
**pgpt_pte == NULL" modified the code to pass "&gpt_head" to
is_gpt_valid() rather than the previous "gpt_head". However, gpt_head
is a pointer to the buffer, not the actual buffer, since it was allocated
using ALLOC_CACHE_ALIGN_BUFFER. This caused is_gpt_valid() to read the
disk block onto the stack rather than into the buffer, causing the
code to fail.

This change reverts that portion of the commit mentioned above.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
 disk/part_efi.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/disk/part_efi.c b/disk/part_efi.c
index e7f2714..ddf80a7 100644
--- a/disk/part_efi.c
+++ b/disk/part_efi.c
@@ -130,7 +130,7 @@ void print_part_efi(block_dev_desc_t * dev_desc)
 	}
 	/* This function validates AND fills in the GPT header and PTE */
 	if (is_gpt_valid(dev_desc, GPT_PRIMARY_PARTITION_TABLE_LBA,
-			 &(gpt_head), &gpt_pte) != 1) {
+			 gpt_head, &gpt_pte) != 1) {
 		printf("%s: *** ERROR: Invalid GPT ***\n", __func__);
 		return;
 	}
@@ -169,7 +169,7 @@ int get_partition_info_efi(block_dev_desc_t * dev_desc, int part,
 
 	/* This function validates AND fills in the GPT header and PTE */
 	if (is_gpt_valid(dev_desc, GPT_PRIMARY_PARTITION_TABLE_LBA,
-			&(gpt_head), &gpt_pte) != 1) {
+			gpt_head, &gpt_pte) != 1) {
 		printf("%s: *** ERROR: Invalid GPT ***\n", __func__);
 		return -1;
 	}
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2011-11-23 20:57 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-28 19:21 [U-Boot] [PATCH] disk: part_efi: fix regression due to incorrect buffer usage Stephen Warren
2011-10-28 19:43 ` Doug Anderson
2011-10-28 22:47   ` Anton Staaf
2011-10-29  0:04     ` Simon Glass
2011-10-30 15:44 ` Mike Frysinger
2011-11-15 18:25   ` Anton Staaf
2011-11-22 22:10     ` Simon Glass
2011-11-22 22:38       ` Anatolij Gustschin
2011-11-22 22:42         ` Simon Glass
2011-11-23  8:30       ` Stefano Babic
2011-11-23 19:18         ` Simon Glass
2011-11-23 20:57           ` stefano babic

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox