[patch] unaligned word write bug

David Ho DavidHo at nanometrics.ca
Thu Oct 21 18:11:28 EDT 2004





Hi all,

This was causing my u-boot fw_setenv utility to fail.
As far as I can tell the latest CVS snapshot still have the bug. The
function involved is map_word_load_partial.

Regards,
David Ho


--- mtd-cvs-20040921/include/linux/mtd/map.h    2004-09-17
18:00:20.000000000 -0400
+++ linuxppc-2.4-bootstrap/include/linux/mtd/map.h      2004-10-21
17:58:35.000000000 -0400
@@ -317,7 +317,7 @@
                        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;





More information about the linux-mtd mailing list