Commit b83dba66b976e38939aa07f3eb1f96098c0e7567

Authored by Ye Li
1 parent 2bfe86770d

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 39c9261fd057b0fa98f9dfdee7d368aa029ff736)

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

drivers/block/dwc_ahsata.c
... ... @@ -615,6 +615,9 @@
615 615 while (readl(&host_mmio->ghc) & SATA_HOST_GHC_HR)
616 616 udelay(100);
617 617  
  618 + free(probe_ent);
  619 + memset(&sata_dev_desc[dev], 0, sizeof(struct blk_desc));
  620 +
618 621 return 0;
619 622 }
620 623