mtd: seama: fix image data handling
authorRafał Miłecki <zajec5@gmail.com>
Mon, 9 May 2016 12:54:53 +0000 (12:54 +0000)
committerLuka Perkov <luka@openwrt.org>
Sun, 19 Jun 2016 17:56:13 +0000 (19:56 +0200)
commit1508cf8713d82c5269b98b749cac2fac1a34bc50
tree4a52a89d24638b32ff071ef0be8125122fcbf84c
parentf9e8c4c3ccf15243d860670c22d3b271cd1bcac2
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 <zajec5@gmail.com>
Backport of r49309

git-svn-id: svn://svn.openwrt.org/openwrt/branches/chaos_calmer@49313 3c298f89-4303-0410-b956-a3cf2f4a3e73
package/system/mtd/src/seama.c