diff options
author | Ye Li <ye.li@nxp.com> | 2020-05-03 17:27:03 +0300 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2020-05-09 01:29:10 +0300 |
commit | 6b6c620c824e10a03da3c617aa9f2c6486f7f57a (patch) | |
tree | d7198d3d611b2401b5b889c7fae7199edd275663 /drivers | |
parent | cdff6fba32db88943be2b04639ad6e7746a2be11 (diff) | |
download | u-boot-6b6c620c824e10a03da3c617aa9f2c6486f7f57a.tar.xz |
sata: 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>
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Diffstat (limited to 'drivers')
-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 82fbb50da6..2bc1de8b98 100644 --- a/drivers/ata/dwc_ahsata.c +++ b/drivers/ata/dwc_ahsata.c @@ -918,6 +918,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; } |