From 17c226b683c444eb553a05b93ff04f27240c175e Mon Sep 17 00:00:00 2001 From: Adrian Bonislawski Date: Tue, 28 Nov 2023 08:24:39 +0100 Subject: [PATCH] rimage: ext_manifest: check fwrite status Check fwrite status for error Signed-off-by: Adrian Bonislawski --- tools/rimage/src/ext_manifest.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tools/rimage/src/ext_manifest.c b/tools/rimage/src/ext_manifest.c index c2ee547c7..03a157c08 100644 --- a/tools/rimage/src/ext_manifest.c +++ b/tools/rimage/src/ext_manifest.c @@ -198,7 +198,12 @@ int ext_man_write_cavs_25(struct image *image) for (i = 0; i < count; i++) header.len += mod_ext->ext_mod_config_array[i].header.ext_module_config_length; - fwrite(&header, sizeof(header), 1, image->out_ext_man_fd); + write_ret = fwrite(&header, sizeof(header), 1, image->out_ext_man_fd); + if (write_ret != 1) { + ret = file_error("can't write fw_ext_man_cavs_header", + image->out_ext_man_file); + goto out; + } for (i = 0; i < count; i++) { write_ret = fwrite(&mod_ext->ext_mod_config_array[i].header,