From: Marek Vasut Date: Mon, 27 Jul 2015 20:39:36 +0000 (+0200) Subject: mmc: dw_mmc: Stop bounce buffer even in case of failure X-Git-Tag: KARO-TX6-2015-09-18~525 X-Git-Url: https://git.kernelconcepts.de/?p=karo-tx-uboot.git;a=commitdiff_plain;h=3d19b84c9028471c002c4e026c8ceb0ba7e4b4de mmc: dw_mmc: Stop bounce buffer even in case of failure The driver didn't stop the bounce buffer in case a data transfer failed. This would lead to memory leakage if the communication between the CPU and the card is unreliable. Add the missing call to stop the bounce buffer. Signed-off-by: Marek Vasut Cc: Dinh Nguyen Cc: Pantelis Antoniou Cc: Tom Rini --- diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c index 53a8aca84b..3fffa71166 100644 --- a/drivers/mmc/dw_mmc.c +++ b/drivers/mmc/dw_mmc.c @@ -215,6 +215,7 @@ static int dwmci_send_cmd(struct mmc *mmc, struct mmc_cmd *cmd, mask = dwmci_readl(host, DWMCI_RINTSTS); if (mask & (DWMCI_DATA_ERR | DWMCI_DATA_TOUT)) { printf("%s: DATA ERROR!\n", __func__); + bounce_buffer_stop(&bbstate); return -1; } } while (!(mask & DWMCI_INTMSK_DTO));