]> git.baikalelectronics.ru Git - uboot.git/commit
net: tftp: Fix load_block offset calculation
authorLey Foon Tan <ley.foon.tan@intel.com>
Tue, 25 Aug 2020 02:26:37 +0000 (10:26 +0800)
committerTom Rini <trini@konsulko.com>
Wed, 30 Sep 2020 20:48:18 +0000 (16:48 -0400)
commit9bd2a5a3ab3de52eaac8ccc485e5a518c78c6b62
tree53db6ad1efad50666b6e94ce4b4ec9516be0e3e0
parentb42061031d830e145110b2a6b3aa235b8297b098
net: tftp: Fix load_block offset calculation

When load the last block, the "len" might not be a block size. This cause
loading the incorrect last block data.

The fix change "len" to tftp_block_size and minus one tftp_block_size
for offset calculation.

Use same offset calculation formula as in store_block().

Signed-off-by: Ley Foon Tan <ley.foon.tan@intel.com>
Reviewed-By: Ramon Fried <rfried.dev@gmail.com>
net/tftp.c