All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot-Users] [PATCH] ahci malloc corruption
@ 2007-07-25  4:25 Ed Swarthout
  0 siblings, 0 replies; only message in thread
From: Ed Swarthout @ 2007-07-25  4:25 UTC (permalink / raw)
  To: u-boot

Fix malloc size error in ahci_init_one.  Typically this causes scsi
init to corrupt the devlist and break the coninfo command.
Fix a compiler size warning.

Signed-off-by: Ed Swarthout <Ed.Swarthout@freescale.com>
---
 drivers/ahci.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/ahci.c b/drivers/ahci.c
index 8ceff00..3d82c62 100644
--- a/drivers/ahci.c
+++ b/drivers/ahci.c
@@ -253,13 +253,14 @@ static void ahci_print_info(struct ahci_probe_ent *probe_ent)
 
 static int ahci_init_one(pci_dev_t pdev)
 {
-	u32 iobase, vendor;
+	u32 iobase;
+	u16 vendor;
 	int rc;
 
 	memset((void *)ataid, 0, sizeof(hd_driveid_t *) * AHCI_MAX_PORTS);
 
-	probe_ent = malloc(sizeof(probe_ent));
-	memset(probe_ent, 0, sizeof(probe_ent));
+	probe_ent = malloc(sizeof(struct ahci_probe_ent));
+	memset(probe_ent, 0, sizeof(struct ahci_probe_ent));
 	probe_ent->dev = pdev;
 
 	pci_read_config_dword(pdev, AHCI_PCI_BAR, &iobase);
-- 
1.5.3.rc1.13.g08e38

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2007-07-25  4:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-25  4:25 [U-Boot-Users] [PATCH] ahci malloc corruption Ed Swarthout

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.