mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-10 05:36:55 +03:00
arch: imx9: Fix blk_dwrite/blk_derase error checking
blk_dwrite/blk_derase returns the number of blocks written/erased. The existing check allowed partial writes or partial erase to be considered successful. Fix error handling of blk_dwrite/blk_derase by checking that return value corresponds to the number of blocks written/erased. Signed-off-by: Francois Berder <fberder@outlook.fr>
This commit is contained in:
committed by
Fabio Estevam
parent
dfd83eab76
commit
4feabb2b8a
@@ -304,8 +304,8 @@ static int imx_qb_blk(const char * const ifname,
|
||||
ret = blk_derase(bdesc, offset, load_size);
|
||||
}
|
||||
|
||||
if (!ret) {
|
||||
printf("Failed to write to block device\n");
|
||||
if (ret != load_size) {
|
||||
printf("Failed to %s block device\n", save ? "write to" : "erase");
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user