Commit 148488728486137a790a89e9b869cc938c3e0c57

Authored by Ye Li
1 parent 9bccfd01c6

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>

Showing 1 changed file with 3 additions and 0 deletions Side-by-side Diff

drivers/ata/dwc_ahsata.c
... ... @@ -921,6 +921,9 @@
921 921 while (readl(&host_mmio->ghc) & SATA_HOST_GHC_HR)
922 922 udelay(100);
923 923  
  924 + free(uc_priv);
  925 + memset(&sata_dev_desc[dev], 0, sizeof(struct blk_desc));
  926 +
924 927 return 0;
925 928 }
926 929