]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
sata: dwc_ahsata: Fix incorrect free
authorYe Li <ye.li@nxp.com>
Sun, 3 May 2020 14:27:02 +0000 (22:27 +0800)
committerTom Rini <trini@konsulko.com>
Fri, 8 May 2020 22:29:05 +0000 (18:29 -0400)
Fix coverity issue CID 43665: Free of address-of expression (BAD_FREE)
incorrect_free: free frees incorrect pointer pp.

pp points the port array field of struct ahci_uc_priv, should not free it.

Acked-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Ye Li <ye.li@nxp.com>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
drivers/ata/dwc_ahsata.c

index 4b37a023380c571d4c1ba28d1d668f6a1905093c..82fbb50da62cd3ab4f1bc5536b44c0a8401ff4c9 100644 (file)
@@ -450,7 +450,6 @@ static int ahci_port_start(struct ahci_uc_priv *uc_priv, u8 port)
 
        mem = (u32)malloc(AHCI_PORT_PRIV_DMA_SZ + 1024);
        if (!mem) {
-               free(pp);
                printf("No mem for table!\n");
                return -ENOMEM;
        }