Skip to content

Commit

Permalink
mgmt/mcumgr/lib: Use flash_img_bytes_written to check context
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
de-nordic authored and carlescufi committed Jun 5, 2022
1 parent 5935799 commit e15523d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion subsys/mgmt/mcumgr/lib/cmd/img_mgmt/src/zephyr_img_mgmt.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit e15523d

Please sign in to comment.