projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
dc2ed55
)
mmc: at91_mci: fix pointer errors
author
Wolfgang Muees
<
[email protected]
>
Fri, 5 Mar 2010 21:43:38 +0000
(13:43 -0800)
committer
Linus Torvalds
<
[email protected]
>
Sat, 6 Mar 2010 19:26:37 +0000
(11:26 -0800)
Fixes two pointer errors, one which leads to memory overwrites if used
with large chunks of data.
Signed-off-by: Wolfgang Muees <
[email protected]
>
Signed-off-by: Nicolas Ferre <
[email protected]
>
Cc: Andrew Victor <
[email protected]
>
Cc: <
[email protected]
>
Signed-off-by: Andrew Morton <
[email protected]
>
Signed-off-by: Linus Torvalds <
[email protected]
>
drivers/mmc/host/at91_mci.c
patch
|
blob
|
history
diff --git
a/drivers/mmc/host/at91_mci.c
b/drivers/mmc/host/at91_mci.c
index 63924e0c7ea9a6c3fab8c2b38857be8832149612..4e1b2e6288dae295a1fb2e1a8699823515d6e163 100644
(file)
--- 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;