mtd: seama: fix image data handling
authorRafał Miłecki <[email protected]>
Mon, 9 May 2016 12:54:53 +0000 (12:54 +0000)
committerRafał Miłecki <[email protected]>
Mon, 9 May 2016 12:54:53 +0000 (12:54 +0000)
commit5e65b81a9c781588d913da3b3e70f70185ecd912
tree4a52a89d24638b32ff071ef0be8125122fcbf84c
parentd6a3a48aa2cb5ea00e03ca3c68b83815b0df77c5
mtd: seama: fix image data handling

1) Put sanity checks in one place
2) Respect provided offset
3) Read only as much data as needed for MD5 calculation

Thanks to the last change this is a great speedup and memory saver. On
devices with NAND flash we were allocating & reading about 128 MiB while
something about 8 MiB is enough.

Signed-off-by: Rafał Miłecki <[email protected]>
Backport of r49309

SVN-Revision: 49313
package/system/mtd/src/seama.c