summaryrefslogtreecommitdiff
path: root/util/amdfwtool
diff options
context:
space:
mode:
Diffstat (limited to 'util/amdfwtool')
-rw-r--r--util/amdfwtool/amdfwtool.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/util/amdfwtool/amdfwtool.c b/util/amdfwtool/amdfwtool.c
index 303a31df3f..406ae0560b 100644
--- a/util/amdfwtool/amdfwtool.c
+++ b/util/amdfwtool/amdfwtool.c
@@ -298,7 +298,11 @@ static uint32_t integrate_firmwares(char *base, uint32_t pos, uint32_t *romsig,
free(base);
exit(1);
}
- fstat(fd, &fd_stat);
+ if (fstat(fd, &fd_stat)) {
+ printf("fstat error: %s\n", strerror(errno));
+ free(base);
+ exit(1);
+ }
switch (fw_table[i].type) {
case AMD_FW_IMC:
@@ -369,7 +373,11 @@ static uint32_t integrate_psp_firmwares(char *base, uint32_t pos,
free(base);
exit(1);
}
- fstat(fd, &fd_stat);
+ if (fstat(fd, &fd_stat)) {
+ printf("fstat error: %s\n", strerror(errno));
+ free(base);
+ exit(1);
+ }
pspdir[4+4*i+1] = (uint32_t)fd_stat.st_size;
pspdir[4+4*i+2] = pos + rom_base_address;