diff options
author | stefanct <stefanct@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1> | 2014-05-16 17:52:04 +0000 |
---|---|---|
committer | stefanct <stefanct@2b7e53f0-3cfb-0310-b3e9-8179ed1497e1> | 2014-05-16 17:52:04 +0000 |
commit | 2644c4bea45065d1ca3eba2bf7cca569cc5b50e8 (patch) | |
tree | 0baa0faba2c3b478cf20500dcab3d0ae820f1f39 /wbsio_spi.c | |
parent | 53ef6fc7651d59982f002da746d66db965d7eddc (diff) | |
download | flashrom-2644c4bea45065d1ca3eba2bf7cca569cc5b50e8.tar.gz |
AT45DB: fix read functions.
This fixes segfaults on reads (implicit reads on writes too), ouch.
Thanks to The Raven for reporting the problem and testing my patch, and
to Alexander Irenkov for providing a workable fix for it additionally.
There were actually two problems:
1) The loop conditions were bogus which could lead to read errors
(e.g. on implicit erase verifications).
2) The offset used within the read buffers provided to spi_nbyte_read()
and memcpy() were not starting at 0 but the offset of the block
within the flash chip (which has nothing to do with read buffer in
most cases).
This patch works similarly to Alexander's but is intended to be
more readable.
Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
git-svn-id: https://code.coreboot.org/svn/flashrom/trunk@1792 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1
Diffstat (limited to 'wbsio_spi.c')
0 files changed, 0 insertions, 0 deletions