diff options
author | Xiaoming Ni <[email protected]> | 2020-03-20 11:15:11 +0800 |
---|---|---|
committer | Miquel Raynal <[email protected]> | 2020-03-24 23:02:30 +0100 |
commit | 4e4a9a828af29785fad12ecc11583769e1282024 (patch) | |
tree | 9b992e2e78e1ce48d37ff070d14caca0cc248a06 /drivers/mtd/lpddr/lpddr_cmds.c | |
parent | f1ffdbfad00a3c424cadfd307b5bb9c466638532 (diff) |
mtd: Fix issue where write_cached_data() fails but write() still returns success
The following sequence is problematic:
mtdblock_flush()
-->write_cached_data()
--->erase_write()
mtdblock: erase of region [0x40000, 0x20000] on "xxx" failed
Problem is: mtdblock_flush() always returns 0. Indeed, even if
write_cached_data() fails and data is not written to the device,
syscall_write() still returns success. Avoid this situation by
actually returning the error coming out of write_cached_data().
Signed-off-by: Xiaoming Ni <[email protected]>
Signed-off-by: Miquel Raynal <[email protected]>
Link: https://lore.kernel.org/linux-mtd/[email protected]
Diffstat (limited to 'drivers/mtd/lpddr/lpddr_cmds.c')
0 files changed, 0 insertions, 0 deletions