diff options
author | Dustin Byford <dustin@cumulusnetworks.com> | 2014-03-07 04:48:23 (GMT) |
---|---|---|
committer | Tom Rini <trini@ti.com> | 2014-03-12 21:04:29 (GMT) |
commit | 4b774ff114201175ea9c05dfa12eef3ff1704753 (patch) | |
tree | 2aacf5076cbafc8387458a2f432e244d586d85b4 /arch | |
parent | 23869bf80b68af9ef1802b9e556f4fd0e9e57fe5 (diff) | |
download | u-boot-fsl-qoriq-4b774ff114201175ea9c05dfa12eef3ff1704753.tar.xz |
fw_env: correct writes to devices with small erase blocks
Some NOR flash devices have a small erase block size. For example, the
Micron N25Q512 can erase in 4K blocks. These devices expose a bug in
fw_env.c where flash_write_buf() incorrectly calculates bytes written
and attempts to write past the environment sectors. Luckily, a range
check prevents any real damage, but this does cause fw_setenv to fail
with an error.
This change corrects the write length calculation.
The bug was introduced with commit 56086921 from 2008 and only affects
configurations where the erase block size is smaller than the total
environment data size.
Signed-off-by: Dustin Byford <dustin@cumulusnetworks.com>
Diffstat (limited to 'arch')
0 files changed, 0 insertions, 0 deletions