提交 636fdbf8 编写于 作者: C Christian Riesch 提交者: Brian Norris

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: NChristian Riesch <christian.riesch@omicron.at>
Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
上级 4612c715
......@@ -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 */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册