summaryrefslogtreecommitdiff
path: root/include/spl_load.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/spl_load.h')
-rw-r--r--include/spl_load.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/spl_load.h b/include/spl_load.h
index 1c2b296c0a2..935f7d336f2 100644
--- a/include/spl_load.h
+++ b/include/spl_load.h
@@ -22,7 +22,7 @@ static inline int _spl_load(struct spl_image_info *spl_image,
read = info->read(info, offset, ALIGN(sizeof(*header),
spl_get_bl_len(info)), header);
- if (read < sizeof(*header))
+ if (read < (int)sizeof(*header))
return -EIO;
if (image_get_magic(header) == FDT_MAGIC) {
@@ -83,6 +83,10 @@ static inline int _spl_load(struct spl_image_info *spl_image,
read = info->read(info, offset + image_offset, size,
map_sysmem(spl_image->load_addr - overhead, size));
+
+ if (read < 0)
+ return read;
+
return read < spl_image->size ? -EIO : 0;
}