tests: subsys: dfu: mcuboot: fix return value not handling issue

Function flash_read was calling without checking return value.
(Coverity CID: 178794)
This patch cover this issue.

Signed-off-by: Andrzej Puzdrowski <andrzej.puzdrowski@nordicsemi.no>
This commit is contained in:
Andrzej Puzdrowski 2017-11-14 12:34:11 +01:00 committed by Anas Nashif
parent 1d70a39d1b
commit 2adbed8d6d
1 changed files with 2 additions and 1 deletions

View File

@ -28,7 +28,8 @@ void test_bank_erase(void)
for (offs = FLASH_AREA_IMAGE_1_OFFSET;
offs <= FLASH_AREA_IMAGE_1_OFFSET + FLASH_AREA_IMAGE_1_SIZE;
offs += sizeof(temp)) {
flash_read(flash_dev, offs, &temp, sizeof(temp));
ret = flash_read(flash_dev, offs, &temp, sizeof(temp));
zassert_true(ret == 0, "Reading from flash");
if (temp != 0xFFFFFFFF) {
ret = flash_write_protection_set(flash_dev, false);
zassert_true(ret == 0, "Disabling flash protection");