summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/host/osmocon/osmocon.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/host/osmocon/osmocon.c b/src/host/osmocon/osmocon.c
index 1bb0bb7d..61672a3f 100644
--- a/src/host/osmocon/osmocon.c
+++ b/src/host/osmocon/osmocon.c
@@ -287,6 +287,11 @@ int read_file(const char *filename, int chainload)
}
rc = fstat(fd, &st);
+ if (rc < 0) {
+ perror("fstat");
+ close(fd);
+ return -EIO;
+ }
if ((st.st_size > MAX_DNLOAD_SIZE) && (dnload.mode != MODE_ROMLOAD)) {
fprintf(stderr, "The maximum file size is 64kBytes (%u bytes)\n",
MAX_DNLOAD_SIZE);