diff options
author | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2011-04-01 11:11:15 +0300 |
---|---|---|
committer | Artem Bityutskiy <Artem.Bityutskiy@nokia.com> | 2011-04-01 19:31:43 +0300 |
commit | b22f7f386ba37a766aedd8e8cf34781a3d1daad2 (patch) | |
tree | c26b840b058253061ed72b5c403728621d523885 /ubi-utils/src/libubigen.c | |
parent | 82869c99a0d0a948fa095c2e04cf01172f6338f3 (diff) |
libmtd: fix OOB read and write interfacev1.4.4
When reading and writing OOB we specify the address as absolute
offset from the beginning of the MTD device. This offset is
basically an absolute page offset plus the OOB offset. And it does
not have to be aligned to the min. I/O unit size (NAND page size).
So fix the 'do_oob_op()' function and remove incorrect checking
that the offset is page-aligned. This check leads to the following
errors:
libmtd: error!: unaligned address 2, mtd0 page size is 2048
But obviously, the intent was to write to offset 2 of the OOB area
of the very first NAND page.
Instead of that incorrect check, we should check that the OOB offset
we write to is within the OOB size and the length is withing the OOB
size. This patch adds such check.
Reported-by: Kelly Anderson <kelly@silka.with-linux.com>
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Tested-by: Kelly Anderson <kelly@silka.with-linux.com>
Diffstat (limited to 'ubi-utils/src/libubigen.c')
0 files changed, 0 insertions, 0 deletions