提交 c3cb77f8 编写于 作者: D Dan Carpenter 提交者: Brian Norris

mtd: silence some uninitialized variable warnings

The "tmp_retlen" variable can be uninitialized if action() fails.  It's
harmless except for the static checker warning.  I have moved the error
handling earlier to fix it.
Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NBrian Norris <computersforpeace@gmail.com>
上级 ef158bdf
...@@ -3188,13 +3188,13 @@ static int onenand_otp_walk(struct mtd_info *mtd, loff_t from, size_t len, ...@@ -3188,13 +3188,13 @@ static int onenand_otp_walk(struct mtd_info *mtd, loff_t from, size_t len,
size_t tmp_retlen; size_t tmp_retlen;
ret = action(mtd, from, len, &tmp_retlen, buf); ret = action(mtd, from, len, &tmp_retlen, buf);
if (ret)
break;
buf += tmp_retlen; buf += tmp_retlen;
len -= tmp_retlen; len -= tmp_retlen;
*retlen += tmp_retlen; *retlen += tmp_retlen;
if (ret)
break;
} }
otp_pages--; otp_pages--;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册