summaryrefslogtreecommitdiffstats
path: root/drivers/mtd
diff options
context:
space:
mode:
authorChristian Riesch <christian.riesch@omicron.at>2015-03-31 23:29:22 +0200
committerBrian Norris <computersforpeace@gmail.com>2015-05-27 12:47:37 -0700
commit636fdbf88efe069f9951d1b7df8d3fd82060dc60 (patch)
treeae830b40f01d8c7ba0baad43b6b162e5ace4170b /drivers/mtd
parent4612c715a6ea6b3af2aee0163c0721375b2548d7 (diff)
downloadlinux-636fdbf88efe069f9951d1b7df8d3fd82060dc60.tar.gz
linux-636fdbf88efe069f9951d1b7df8d3fd82060dc60.tar.bz2
linux-636fdbf88efe069f9951d1b7df8d3fd82060dc60.zip
mtd: cfi_cmdset_0002: Initialize datum before calling map_word_load_partial
In do_otp_write we must initialize the variable datum before calling map_word_load_partial. Otherwise the upper bits of datum may be undefined, which later causes problems in chip_good called by do_write_oneword. Signed-off-by: Christian Riesch <christian.riesch@omicron.at> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Diffstat (limited to 'drivers/mtd')
-rw-r--r--drivers/mtd/chips/cfi_cmdset_0002.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/mtd/chips/cfi_cmdset_0002.c b/drivers/mtd/chips/cfi_cmdset_0002.c
index c50d8cf0f60d..c3624eb571d1 100644
--- a/drivers/mtd/chips/cfi_cmdset_0002.c
+++ b/drivers/mtd/chips/cfi_cmdset_0002.c
@@ -1295,7 +1295,7 @@ static int do_otp_write(struct map_info *map, struct flchip *chip, loff_t adr,
unsigned long bus_ofs = adr & ~(map_bankwidth(map)-1);
int gap = adr - bus_ofs;
int n = min_t(int, len, map_bankwidth(map) - gap);
- map_word datum;
+ map_word datum = map_word_ff(map);
if (n != map_bankwidth(map)) {
/* partial write of a word, load old contents */