diff options
| author | David Woodhouse <dwmw2@shinybook.infradead.org> | 2005-01-05 20:15:36 +0100 |
|---|---|---|
| committer | David Woodhouse <dwmw2@shinybook.infradead.org> | 2005-01-05 20:15:36 +0100 |
| commit | 75315d1c0d4633a3abd7fcc1b073ac9669cdf578 (patch) | |
| tree | 94d520b8668b01531a54871f6dcd7f6364e41478 /include/linux/mtd | |
| parent | 1c66c552c22840c8c1ebe728e6c99d54c3ca5e0c (diff) | |
[MTD] Bug in 2.6.10 mtd driver for physmem mapped flash chips
The patch below fixes a small but fatal bug in the code that handles
non-buswidth-aligned writes. The problem is that the code used the same
index in both map_word and buf, therefore putting the wrong words in the
map_word that partially contains old data and partially contains new
data. The result: corrupt data is being written.
Signed-off-by: Koen Martens <kmartens@sonologic.nl>
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Diffstat (limited to 'include/linux/mtd')
| -rw-r--r-- | include/linux/mtd/map.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/linux/mtd/map.h b/include/linux/mtd/map.h index a960be2cc33c..f0268b99c900 100644 --- a/include/linux/mtd/map.h +++ b/include/linux/mtd/map.h @@ -1,6 +1,6 @@ /* Overhauled routines for dealing with different mmap regions of flash */ -/* $Id: map.h,v 1.45 2004/09/21 14:31:17 bjd Exp $ */ +/* $Id: map.h,v 1.46 2005/01/05 17:09:44 dwmw2 Exp $ */ #ifndef __LINUX_MTD_MAP_H__ #define __LINUX_MTD_MAP_H__ @@ -322,7 +322,7 @@ static inline map_word map_word_load_partial(struct map_info *map, map_word orig bitpos = (map_bankwidth(map)-1-i)*8; #endif orig.x[0] &= ~(0xff << bitpos); - orig.x[0] |= buf[i] << bitpos; + orig.x[0] |= buf[i-start] << bitpos; } } return orig; |
