summaryrefslogtreecommitdiff
path: root/drivers/mtd/nand
diff options
context:
space:
mode:
authorHuang Shijie <b32955@freescale.com>2010-11-22 11:31:47 +0800
committerAlan Tull <alan.tull@freescale.com>2011-02-03 16:31:37 -0600
commit09d42460af9406f289cc997c6c3ada2a89151b7d (patch)
treeccb51afede1e337fb2707c427d1c49d27e9dbca4 /drivers/mtd/nand
parent6fa82aa5d882c189e8e306825d2bf3e67317fccc (diff)
ENGR00133908 NAND : fix the wrong size for memcpy in mil_ecc_write_page()
The buffer mil->auxiliary_virt only have nfc_goe->auxiliary_size_in_bytes bytes in size which is mostly very small(e.g 10 + 8). But the mtd->oobsize maybe more then one hundred. So the memcpy is overflow. Signed-off-by: Huang Shijie <b32955@freescale.com>
Diffstat (limited to 'drivers/mtd/nand')
-rw-r--r--drivers/mtd/nand/gpmi-nfc/gpmi-nfc-mil.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/mtd/nand/gpmi-nfc/gpmi-nfc-mil.c b/drivers/mtd/nand/gpmi-nfc/gpmi-nfc-mil.c
index 9dfd76edc5f4..5774e27c372f 100644
--- a/drivers/mtd/nand/gpmi-nfc/gpmi-nfc-mil.c
+++ b/drivers/mtd/nand/gpmi-nfc/gpmi-nfc-mil.c
@@ -764,7 +764,8 @@ static void mil_ecc_write_page(struct mtd_info *mtd,
payload_virt = mil->payload_virt;
payload_phys = mil->payload_phys;
- memcpy(mil->auxiliary_virt, nand->oob_poi, mtd->oobsize);
+ memcpy(mil->auxiliary_virt, nand->oob_poi,
+ nfc_geo->auxiliary_size_in_bytes);
auxiliary_virt = mil->auxiliary_virt;
auxiliary_phys = mil->auxiliary_phys;