diff options
author | Ye Li <ye.li@nxp.com> | 2018-03-27 00:45:10 -0700 |
---|---|---|
committer | Ye Li <ye.li@nxp.com> | 2020-04-26 23:24:19 -0700 |
commit | 87dbb8594ee6634f8b76f36f8d9d43ca62300376 (patch) | |
tree | 979584e4500a778ca45b6379ce4f50ae2cec9e9e /drivers/ata | |
parent | aefaf1b93a578da133c017c21758ef8bfcd1b009 (diff) |
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 148488728486137a790a89e9b869cc938c3e0c57)
(cherry picked from commit ceab4ca7f201545b030b0bf5a087dc7c30e18005)
Diffstat (limited to 'drivers/ata')
-rw-r--r-- | drivers/ata/dwc_ahsata.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/ata/dwc_ahsata.c b/drivers/ata/dwc_ahsata.c index c2e28fe518e..5e810fc5ecf 100644 --- a/drivers/ata/dwc_ahsata.c +++ b/drivers/ata/dwc_ahsata.c @@ -914,6 +914,9 @@ int reset_sata(int dev) while (readl(&host_mmio->ghc) & SATA_HOST_GHC_HR) udelay(100); + free(uc_priv); + memset(&sata_dev_desc[dev], 0, sizeof(struct blk_desc)); + return 0; } |