]> www.infradead.org Git - mtd-utils.git/commit
ubiformat: fix segfault and messages
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Sat, 18 Apr 2009 13:35:22 +0000 (16:35 +0300)
committerArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Sat, 18 Apr 2009 13:45:39 +0000 (16:45 +0300)
commita09d039bfe84170b90df54461a0155db5bb2495c
tree2fc0897de402fe29f8e2ec276e9cc8303b2ebb55
parent194b2a55f626b94323b377d75edb295f536359c5
ubiformat: fix segfault and messages

ubiformat segfaults like this:

ubiformat: mtd0 (NAND), size 134217728 bytes (128.0 MiB), 16384 eraseblocks of 16384 bytes (16.0 KiB), min. I/O size 512 bytes
libscan: scanning eraseblock 8191 -- 100 % complete
ubiformat: 8190 eraseblocks have valid erase counter, mean value is 9
ubiformat: 2 eraseblocks are supposedly empty
ubiformat: warning!: VID header and data offsets on flash are 512 and 1024, which is different to calculated offsets 256 and 512
ubiformat: use new offsets 512 and 1024? (yes/no)  no
Segmentation fault

The reason is that volume table size is calculated for 256/512
layout, and when user chooses 512/1024 - it is not re-calculated
which leads to segfault in 'ubigen_write_layout_vol()'.

This patch also fixes the message - in the above output new
offsets are 256/512, not 512/1024.

Also, this patch adds explicit printing of the selected
positions.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
ubi-utils/src/ubiformat.c