summaryrefslogtreecommitdiffstats
path: root/common/spl/spl_mmc.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/spl/spl_mmc.c')
-rw-r--r--common/spl/spl_mmc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/common/spl/spl_mmc.c b/common/spl/spl_mmc.c
index e369ce3975..f27b4c277b 100644
--- a/common/spl/spl_mmc.c
+++ b/common/spl/spl_mmc.c
@@ -13,6 +13,7 @@
#include <mmc.h>
#include <fat.h>
#include <version.h>
+#include <image.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -30,6 +31,9 @@ static int mmc_load_image_raw(struct mmc *mmc, unsigned long sector)
if (err == 0)
goto end;
+ if (image_get_magic(header) != IH_MAGIC)
+ return -1;
+
spl_parse_image_header(header);
/* convert size to sectors - round up */
OpenPOWER on IntegriCloud