mgmt/mcumgr/lib: Use flash_img_bytes_written to check context
The commit replaces direct access to flash_img_context, for the purpose of checking how much data has been written, with call to the flash_img_bytes_written. Signed-off-by: Dominik Ermel <dominik.ermel@nordicsemi.no>
This commit is contained in:
parent
59357998d1
commit
e15523d198
|
@ -393,7 +393,7 @@ img_mgmt_impl_write_image_data(unsigned int offset, const void *data, unsigned i
|
|||
}
|
||||
}
|
||||
|
||||
if (offset != ctx->stream.bytes_written + ctx->stream.buf_bytes) {
|
||||
if (offset != flash_img_bytes_written(ctx) + ctx->stream.buf_bytes) {
|
||||
rc = MGMT_ERR_EUNKNOWN;
|
||||
goto out;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue