1
0
Fork 0

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: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
hifive-unleashed-5.1
Dan Carpenter 2016-04-13 09:42:34 +03:00 committed by Brian Norris
parent ef158bdf83
commit c3cb77f898
1 changed files with 2 additions and 2 deletions

View File

@ -3188,13 +3188,13 @@ static int onenand_otp_walk(struct mtd_info *mtd, loff_t from, size_t len,
size_t tmp_retlen;
ret = action(mtd, from, len, &tmp_retlen, buf);
if (ret)
break;
buf += tmp_retlen;
len -= tmp_retlen;
*retlen += tmp_retlen;
if (ret)
break;
}
otp_pages--;
}