Browse Source

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 39c9261fd0)
imx_v2017.03_4.9.11_1.0.0_ga
Ye Li 4 years ago
parent
commit
b83dba66b9
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      drivers/block/dwc_ahsata.c

+ 3
- 0
drivers/block/dwc_ahsata.c View File

@ -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;
}


Loading…
Cancel
Save