diff options
author | Patrick Georgi <pgeorgi@google.com> | 2021-04-22 19:41:20 +0200 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-04-28 20:29:23 +0000 |
commit | 20b672e816bc83c60c377396fdadf65cb6ec1858 (patch) | |
tree | 7c9a4412427e4ea019671bc444ff46e0d8931583 /chip | |
parent | abd72bf6f8fbcfc8f7d6c80e1e807dd0e6248f1b (diff) | |
download | chrome-ec-20b672e816bc83c60c377396fdadf65cb6ec1858.tar.gz |
chip/host: assert that reading emulated flash is successful
BUG=b:185477664
BRANCH=none
TEST=new toolchain doesn't fail on chip/host/flash.c anymore.
Change-Id: I3237622cbfaf47b5e4bb9cc1ad5f60422718400b
Signed-off-by: Patrick Georgi <pgeorgi@google.com>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2846332
Reviewed-by: Patrick Georgi <pgeorgi@chromium.org>
Reviewed-by: Manoj Gupta <manojgupta@chromium.org>
Commit-Queue: Patrick Georgi <pgeorgi@chromium.org>
Tested-by: Patrick Georgi <pgeorgi@chromium.org>
Diffstat (limited to 'chip')
-rw-r--r-- | chip/host/flash.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/chip/host/flash.c b/chip/host/flash.c index 486c418065..95d46d9f34 100644 --- a/chip/host/flash.c +++ b/chip/host/flash.c @@ -52,6 +52,7 @@ static void flash_set_persistent(void) static void flash_get_persistent(void) { FILE *f = get_persistent_storage("flash", "rb"); + int sz; if (f == NULL) { fprintf(stderr, @@ -60,7 +61,8 @@ static void flash_get_persistent(void) return; } - fread(__host_flash, sizeof(__host_flash), 1, f); + sz = fread(__host_flash, sizeof(__host_flash), 1, f); + ASSERT(sz == 1); release_persistent_storage(f); } |