summaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/lib/bootm.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/arch/arm/lib/bootm.c b/arch/arm/lib/bootm.c
index 8068a53be0..25efb42541 100644
--- a/arch/arm/lib/bootm.c
+++ b/arch/arm/lib/bootm.c
@@ -250,8 +250,10 @@ static int do_bootz_linux_fdt(int fd, struct image_data *data)
header = &__header;
ret = read(fd, header, sizeof(*header));
- if (ret < sizeof(*header))
+ if (ret < 0)
return ret;
+ if (ret < sizeof(*header))
+ return -ENXIO;
if (file_detect_type(header, sizeof(*header)) != filetype_oftree)
return -ENXIO;