MLK-14930-2 dwc_ahsata: Fix memory issue in reset_sata
authorYe Li <ye.li@nxp.com>
Wed, 24 May 2017 07:13:00 +0000 (02:13 -0500)
committerJason Liu <jason.hui.liu@nxp.com>
Thu, 2 Nov 2017 18:36:52 +0000 (02:36 +0800)
The reset_sata should reset the sata device info and free the probe_ent
memory. Otherwise, it will cause memory leak if we init the sata again.

Signed-off-by: Ye Li <ye.li@nxp.com>
drivers/block/dwc_ahsata.c

index c306e92..c05896f 100644 (file)
@@ -615,6 +615,9 @@ int reset_sata(int dev)
        while (readl(&host_mmio->ghc) & SATA_HOST_GHC_HR)
                udelay(100);
 
+       free(probe_ent);
+       memset(&sata_dev_desc[dev], 0, sizeof(struct blk_desc));
+
        return 0;
 }