From b83dba66b976e38939aa07f3eb1f96098c0e7567 Mon Sep 17 00:00:00 2001 From: Ye Li Date: Wed, 24 May 2017 02:13:00 -0500 Subject: 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 (cherry picked from commit 39c9261fd057b0fa98f9dfdee7d368aa029ff736) --- drivers/block/dwc_ahsata.c | 3 +++ 1 file changed, 3 insertions(+) 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; } -- cgit v1.1