linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/7] mmc: at91_mci: fix pointer errors
  2010-02-26 20:20 ` [PATCH 1/7] mmc: at91_mci: fix pointer errors Dan Carpenter
@ 2010-03-01 17:44 Nicolas Ferre
  2010-02-26 18:39 ` [PATCH 2/7] mmc: at91_mci: fix timeout errors Nicolas Ferre
                   ` (7 more replies)
  -1 siblings, 8 replies; 17+ messages in thread
From: Nicolas Ferre @ 2010-03-01 17:44 UTC (permalink / raw)
  To: linux-arm-kernel

From: Wolfgang Muees <wolfgang.mues@auerswald.de>

Fixes two pointer errors, one which leads to memory overwrites if used with
large chunks of data.

Signed-off-by: Wolfgang Muees <wolfgang.mues@auerswald.de>
Signed-off-by: Nicolas Ferre <nicolas.ferre@atmel.com>
---
 drivers/mmc/host/at91_mci.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/mmc/host/at91_mci.c b/drivers/mmc/host/at91_mci.c
index 63924e0..6835104 100644
--- a/drivers/mmc/host/at91_mci.c
+++ b/drivers/mmc/host/at91_mci.c
@@ -227,11 +227,13 @@ static inline void at91_mci_sg_to_dma(struct at91mci_host *host, struct mmc_data
 			for (index = 0; index < (amount / 4); index++)
 				*dmabuf++ = swab32(sgbuffer[index]);
 		} else {
-			memcpy(dmabuf, sgbuffer, amount);
-			dmabuf += amount;
+			char *tmpv = (char *)dmabuf;
+			memcpy(tmpv, sgbuffer, amount);
+			tmpv += amount;
+			dmabuf = (unsigned *)tmpv;
 		}
 
-		kunmap_atomic(sgbuffer, KM_BIO_SRC_IRQ);
+		kunmap_atomic(((void *)sgbuffer) - sg->offset, KM_BIO_SRC_IRQ);
 
 		if (size == 0)
 			break;
-- 
1.5.6.5

^ permalink raw reply related	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2010-08-30  7:05 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-01 17:44 [PATCH 1/7] mmc: at91_mci: fix pointer errors Nicolas Ferre
2010-02-26 18:39 ` [PATCH 2/7] mmc: at91_mci: fix timeout errors Nicolas Ferre
2010-02-26 18:39 ` [PATCH 3/7] mmc: at91_mci: use one coherent DMA buffer Nicolas Ferre
2010-02-26 18:39 ` [PATCH 4/7] mmc: at91_mci: use DMA buffer for read Nicolas Ferre
2010-03-02 21:34   ` Andrew Morton
2010-03-03  7:34     ` Wolfgang Mües
2010-03-03 14:17     ` [PATCH] mmc: at91_mci: correct kunmap_atomic() Nicolas Ferre
2010-02-26 18:39 ` [PATCH 5/7] mmc: at91_mci: enable large data blocks Nicolas Ferre
2010-02-26 18:39 ` [PATCH 6/7] mmc: at91_mci: Enable MMC_CAP_SDIO_IRQ only when it actually works Nicolas Ferre
2010-02-26 18:39 ` [PATCH 7/7] mmc: at91_mci: introduce per-mci-revision conditional code Nicolas Ferre
2010-02-26 20:20 ` [PATCH 1/7] mmc: at91_mci: fix pointer errors Dan Carpenter
2010-08-27 19:33 ` Chris Ball
2010-08-27 19:34   ` Chris Ball
2010-08-30  6:51     ` Wolfgang Mües
2010-08-29 21:39   ` Ryan Mallon
2010-08-30  6:56     ` Wolfgang Mües
2010-08-30  7:05       ` Ryan Mallon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).