[U-Boot] [PATCH 1/4] mmc: dw_mmc: Stop bounce buffer even in case of failure

Pantelis Antoniou panto at antoniou-consulting.com
Wed Aug 12 09:25:59 CEST 2015


Hi Marek,

> On Jul 27, 2015, at 23:39 , Marek Vasut <marex at denx.de> wrote:
> 
> 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 <marex at denx.de>
> Cc: Dinh Nguyen <dinguyen at opensource.altera.com>
> Cc: Pantelis Antoniou <panto at antoniou-consulting.com>
> Cc: Tom Rini <trini at konsulko.com>
> ---
> drivers/mmc/dw_mmc.c | 1 +
> 1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/mmc/dw_mmc.c b/drivers/mmc/dw_mmc.c
> index 53a8aca..3fffa71 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));
> -- 
> 2.1.4
> 

Applied, thanks.

— Pantelis



More information about the U-Boot mailing list