summaryrefslogtreecommitdiff
path: root/drivers/ata/ahci.c
diff options
context:
space:
mode:
authorVincent Stehlé <vincent.stehle@arm.com>2025-03-24 09:34:06 +0100
committerTom Rini <trini@konsulko.com>2025-04-08 16:23:27 -0600
commita345f44a60f57a2741cda9315312d3df28bc22f0 (patch)
tree1d182e782bebf50b13adf8ad12636f41ad0d2088 /drivers/ata/ahci.c
parent65504478fe44f6dd8b61907efa4eaeba5b79cbf5 (diff)
ata: ahci: remove bad free
In the case of a memory allocation error, the ahci_port_start() function tries to free the `pp' pointer. This pointer was not dynamically allocated but does in fact point to an element of the port[] array member of the struct ahci_uc_priv. Remove the erroneous call to free() to fix this. Fixes: 4782ac80b02f ("Add AHCI support to u-boot") Signed-off-by: Vincent Stehlé <vincent.stehle@arm.com> Cc: Tom Rini <trini@konsulko.com> Cc: Jason Jin <jason.jin@freescale.com> Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Diffstat (limited to 'drivers/ata/ahci.c')
-rw-r--r--drivers/ata/ahci.c1
1 files changed, 0 insertions, 1 deletions
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c
index 8058d5ff1c3..e593e228685 100644
--- a/drivers/ata/ahci.c
+++ b/drivers/ata/ahci.c
@@ -463,7 +463,6 @@ static int ahci_port_start(struct ahci_uc_priv *uc_priv, u8 port)
mem = memalign(2048, AHCI_PORT_PRIV_DMA_SZ);
if (!mem) {
- free(pp);
printf("%s: No mem for table!\n", __func__);
return -ENOMEM;
}