summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorYe Li <ye.li@nxp.com>2017-05-24 02:13:00 -0500
committerYe Li <ye.li@nxp.com>2017-05-24 03:22:05 -0500
commitb83dba66b976e38939aa07f3eb1f96098c0e7567 (patch)
treee93b755fcec409f2c053c29ae32b0f70feedf661 /drivers
parent2bfe86770d875de180f698a65371417d7cd67c43 (diff)
downloadu-boot-imx-b83dba66b976e38939aa07f3eb1f96098c0e7567.zip
u-boot-imx-b83dba66b976e38939aa07f3eb1f96098c0e7567.tar.gz
u-boot-imx-b83dba66b976e38939aa07f3eb1f96098c0e7567.tar.bz2
MLK-14930-2 dwc_ahsata: Fix memory issue in reset_sata
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> (cherry picked from commit 39c9261fd057b0fa98f9dfdee7d368aa029ff736)
Diffstat (limited to 'drivers')
-rw-r--r--drivers/block/dwc_ahsata.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/block/dwc_ahsata.c b/drivers/block/dwc_ahsata.c
index c306e92..c05896f 100644
--- a/drivers/block/dwc_ahsata.c
+++ b/drivers/block/dwc_ahsata.c
@@ -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;
}