From: Ye Li Date: Wed, 24 May 2017 07:13:00 +0000 (-0500) Subject: MLK-14930-2 dwc_ahsata: Fix memory issue in reset_sata X-Git-Tag: rel_imx_4.9.88_2.0.0_ga~530 X-Git-Url: https://git.somdevices.com/?a=commitdiff_plain;h=93112aa5fee8cd5db42d48c5e12d1848aed1593f;p=u-boot.git 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 --- diff --git a/drivers/block/dwc_ahsata.c b/drivers/block/dwc_ahsata.c index c306e927db..c05896fc95 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; }