Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c3cb77f8 authored by Dan Carpenter's avatar Dan Carpenter Committed by Brian Norris
Browse files

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: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarBrian Norris <computersforpeace@gmail.com>
parent ef158bdf
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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--;
	}