Skip to content
Commit cfb05690 authored by Dominik Ermel's avatar Dominik Ermel Committed by Ioannis Glaropoulos
Browse files

storage/stream/flash: Fix flash_sync updating bytes_written on failure



The flash_sync function is able to call, if specified, write
verification callback to check whether data flash has been correctly
written to a flash.  Part of that procedure is to read date back of
the flash and call the verification callback on the buffer;
in case if the read would fail, the flash_sync would return,
with an error code, without updating stream_flash_ctx.

The same logic should be applied to failed verification, but, due to
missing return, the stream_flash_ctx gets updated with probably
incorrectly written bytes added to total bytes_written and buf_bytes,
representing number of bytes awaiting in buffer, being zeroed.

Signed-off-by: default avatarDominik Ermel <dominik.ermel@nordicsemi.no>
parent 94968dfe
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment