mtd: improve check for TRX header being already fixed
authorRafał Miłecki <rafal@milecki.pl>
Sun, 15 Jul 2018 21:23:42 +0000 (23:23 +0200)
committerRafał Miłecki <rafal@milecki.pl>
Tue, 17 Jul 2018 05:17:48 +0000 (07:17 +0200)
commit79c8f2f50bcb2991ba0165a67d8bf3187dbb5bf2
tree95019377f41e737791516eda24a00e1dfcd51828
parent828eaeee2550c954ea98063e59e09980c1361de2
mtd: improve check for TRX header being already fixed

First of all lengths should be compared after checking all blocks for
being good/bad. It's because requested length may differ from a final
one if there were some bad blocks.

Secondly it makes sense to also compare crc32 since we already have a
new one calculated.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
(cherry picked from commit 82498a7f7aa86ad0e93ef60d50dccaa0a9549e4c)
package/system/mtd/Makefile
package/system/mtd/src/trx.c