samples: flash_shell: Fix Coverity issue 220540

Fix possible Uninitialized 'ret' value.

Fixes #34001

Signed-off-by: Kumar Gala <kumar.gala@linaro.org>
This commit is contained in:
Kumar Gala 2021-04-09 05:51:50 -05:00 committed by Anas Nashif
commit 3b84b645db

View file

@ -229,7 +229,7 @@ static int do_write(const struct shell *shell, off_t offset, uint8_t *buf,
static int do_write_unaligned(const struct shell *shell, off_t offset, uint8_t *buf,
size_t len, bool read_back)
{
int ret;
int ret = 0;
size_t page_size = flash_get_write_block_size(flash_device);
size_t size_before = offset % page_size;
size_t size_after = page_size - ((size_before + len) % page_size);