summaryrefslogtreecommitdiffstats
path: root/common/imd.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/imd.c')
-rw-r--r--common/imd.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/common/imd.c b/common/imd.c
index 526308effa..96496514a5 100644
--- a/common/imd.c
+++ b/common/imd.c
@@ -1,9 +1,6 @@
/*
* (C) Copyright 2014 Sascha Hauer, Pengutronix
*
- * See file CREDITS for list of people who contributed to this
- * project.
- *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of
@@ -370,6 +367,7 @@ static int imd_write_crc32(void *buf, const struct imd_header *imd_start,
return -ENODATA;
} else {
uint32_t *p = (uint32_t *)(imd_crc + 1);
+ int ret;
if (*p != crc) {
uint32_t *flags = imd_crc32_flags(imd_crc);
@@ -377,7 +375,11 @@ static int imd_write_crc32(void *buf, const struct imd_header *imd_start,
debug("Update crc token from 0x%08x to 0x%08x (flags 0x%08x)\n", *p, crc, *flags);
*p = crc;
- write_file(filename, buf, size);
+ ret = write_file(filename, buf, size);
+ if (ret < 0) {
+ eprintf("CRC: write crc token to %s failed: %d\n", filename, ret);
+ return ret;
+ }
}
}