ubiformat: handle write errors correctly
This is a barebox adoption of mtd-utils commit
d9cbf6a ("ubiformat: handle write errors correctly"):

|     ubiformat: handle write errors correctly
|
|     This issue was reported and analyzed by
|     Anton Olofsson <anol.martinsson@gmail.com>:
|
|     when ubiformat encounters a write error while flashing the UBI image (which may
|     come from a file of from stdout), it correctly marks the faulty eraseblock as
|     bad and skips it. However, it also incorrectly drops the data buffer which was
|     supposed to be written, and reads next block of data.
|
|     This patch fixes this issue - in case of a write error, we preserve the current
|     data and write it to the next eraseblock, instead of dropping it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
1 parent 3b68dbc commit 84a0eccd41ee6866788fb641cce6ff82728af316
@Sascha Hauer Sascha Hauer authored on 15 Jul 2019
Showing 1 changed file
View
common/ubiformat.c