diff --git a/subsys/storage/stream/stream_flash.c b/subsys/storage/stream/stream_flash.c index 886bb31d59b..282b58f1eb9 100644 --- a/subsys/storage/stream/stream_flash.c +++ b/subsys/storage/stream/stream_flash.c @@ -28,12 +28,12 @@ static int settings_direct_loader(const char *key, size_t len, /* Handle the subtree if it is an exact key match. */ if (settings_name_next(key, NULL) == 0) { size_t bytes_written = 0; - ssize_t len = read_cb(cb_arg, &bytes_written, + ssize_t cb_len = read_cb(cb_arg, &bytes_written, sizeof(bytes_written)); - if (len != sizeof(ctx->bytes_written)) { + if (cb_len != sizeof(ctx->bytes_written)) { LOG_ERR("Unable to read bytes_written from storage"); - return len; + return cb_len; } /* Check that loaded progress is not outdated. */