diff options
Diffstat (limited to 'drivers/mtd/nand/nandsim.c')
-rw-r--r-- | drivers/mtd/nand/nandsim.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/mtd/nand/nandsim.c b/drivers/mtd/nand/nandsim.c index 28ee78544ff2..abebcab47631 100644 --- a/drivers/mtd/nand/nandsim.c +++ b/drivers/mtd/nand/nandsim.c | |||
@@ -852,6 +852,7 @@ static void erase_sector(struct nandsim *ns) | |||
852 | */ | 852 | */ |
853 | static int prog_page(struct nandsim *ns, int num) | 853 | static int prog_page(struct nandsim *ns, int num) |
854 | { | 854 | { |
855 | int i; | ||
855 | union ns_mem *mypage; | 856 | union ns_mem *mypage; |
856 | u_char *pg_off; | 857 | u_char *pg_off; |
857 | 858 | ||
@@ -867,7 +868,8 @@ static int prog_page(struct nandsim *ns, int num) | |||
867 | } | 868 | } |
868 | 869 | ||
869 | pg_off = NS_PAGE_BYTE_OFF(ns); | 870 | pg_off = NS_PAGE_BYTE_OFF(ns); |
870 | memcpy(pg_off, ns->buf.byte, num); | 871 | for (i = 0; i < num; i++) |
872 | pg_off[i] &= ns->buf.byte[i]; | ||
871 | 873 | ||
872 | return 0; | 874 | return 0; |
873 | } | 875 | } |