mtd: seama: fix image data handling
author rmilecki
()
committer rmilecki
()
commit 9a8279b0489f8a15a2f67d40238a581d3284a0c4
tree db0c5be3283b79c103566b616e7a4ea59b7a5040
parent 1b1ecbdbe8ca49bb62b4175cdbb1f2f549875c4d
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>

git-svn-id: svn://svn.openwrt.org/openwrt/trunk@49309 3c298f89-4303-0410-b956-a3cf2f4a3e73
package/system/mtd/src/seama.c
comments