[09/11] tmio_mmc: unmap with the proper sglen

Message ID AANLkTinjCzs12pBZBDF_BUpQa4-NZWW3cbAKtNmEQkq1@mail.gmail.com
State Accepted, archived
Headers show

Commit Message

Linus Walleij March 4, 2011, 10:27 a.m.
---------- Forwarded message ----------
From: Linus Walleij <linus.walleij@linaro.org>
Date: Thu, Feb 10, 2011 at 4:10 PM
Subject: [PATCH 09/11] tmio_mmc: unmap with the proper sglen
To: linux-mmc@vger.kernel.org, Chris Ball <cjb@laptop.org>
Cc: Dan Williams <dan.j.williams@intel.com>, Ian Molton
<ian@mnementh.co.uk>, Linus Walleij <linus.walleij@linaro.org>


According to the DMA-API you shall unmap the sglists with the same
sglist length as passed into the mapping function, not the
returned value from the mapping function.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
---
 drivers/mmc/host/tmio_mmc.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

--
1.7.4

Patch

diff --git a/drivers/mmc/host/tmio_mmc.c b/drivers/mmc/host/tmio_mmc.c
index c82d8e2..5da2e17 100644
--- a/drivers/mmc/host/tmio_mmc.c
+++ b/drivers/mmc/host/tmio_mmc.c
@@ -979,11 +979,11 @@  static void tmio_tasklet_fn(unsigned long arg)

       if (host->data->flags & MMC_DATA_READ)
               dma_unmap_sg(host->chan_rx->device->dev,
-                            host->sg_ptr, host->dma_sglen,
+                            host->sg_ptr, host->sg_len,
                            DMA_FROM_DEVICE);
       else
               dma_unmap_sg(host->chan_tx->device->dev,
-                            host->sg_ptr, host->dma_sglen,
+                            host->sg_ptr, host->sg_len,
                            DMA_TO_DEVICE);

       tmio_mmc_do_data_irq(host);