public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] part_efi: fix protective_mbr struct allocation
@ 2014-02-12 14:40 Hector Palacios
  2014-02-12 14:43 ` Fabio Estevam
  2014-02-12 15:55 ` Lukasz Majewski
  0 siblings, 2 replies; 21+ messages in thread
From: Hector Palacios @ 2014-02-12 14:40 UTC (permalink / raw)
  To: u-boot

The calloc() call was allocating space for the sizeof the struct
pointer rather than for the struct contents.

Signed-off-by: Hector Palacios <hector.palacios@digi.com>
---
 disk/part_efi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/disk/part_efi.c b/disk/part_efi.c
index 5dfaf490c89a..7fabec059d7a 100644
--- a/disk/part_efi.c
+++ b/disk/part_efi.c
@@ -232,7 +232,7 @@ static int set_protective_mbr(block_dev_desc_t *dev_desc)
 	legacy_mbr *p_mbr;
 
 	/* Setup the Protective MBR */
-	p_mbr = calloc(1, sizeof(p_mbr));
+	p_mbr = calloc(1, sizeof(legacy_mbr));
 	if (p_mbr == NULL) {
 		printf("%s: calloc failed!\n", __func__);
 		return -1;

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

end of thread, other threads:[~2014-02-19 15:11 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-12 14:40 [U-Boot] [PATCH] part_efi: fix protective_mbr struct allocation Hector Palacios
2014-02-12 14:43 ` Fabio Estevam
2014-02-12 16:33   ` Albert ARIBAUD
2014-02-12 17:33     ` Fabio Estevam
2014-02-12 17:58       ` Albert ARIBAUD
2014-02-12 15:55 ` Lukasz Majewski
2014-02-12 16:24   ` Palacios, Hector
2014-02-12 16:30     ` Albert ARIBAUD
2014-02-12 16:48       ` Palacios, Hector
2014-02-12 20:45         ` Lukasz Majewski
2014-02-13  2:23           ` Albert ARIBAUD
2014-02-19  8:19             ` Lukasz Majewski
2014-02-19 10:08               ` Albert ARIBAUD
2014-02-19 10:15                 ` Albert ARIBAUD
2014-02-19 12:52                   ` Palacios, Hector
2014-02-19 14:14                     ` Albert ARIBAUD
2014-02-19 14:25                       ` Lukasz Majewski
2014-02-19 14:38                         ` Albert ARIBAUD
2014-02-19 15:11                           ` Lukasz Majewski
2014-02-19 14:22               ` Tom Rini
2014-02-19 15:10                 ` Lukasz Majewski

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