From 6d804c092d93515be02809fd781fa1602561e1fb Mon Sep 17 00:00:00 2001
From: Yann Gautier <yann.gautier@st.com>
Date: Fri, 28 Sep 2018 09:11:06 +0200
Subject: [PATCH] bl2: post process only the loaded image

If an image was not loaded due to its SKIP_LOAD attribute, there is
no reason to post process the image. This change ensures only loaded
images get post processed.

Change-Id: Ib9f84f0f1dd7e811ec400fa999c84a15dd9b6297
Signed-off-by: Etienne Carriere <etienne.carriere@st.com>
Signed-off-by: Yann Gautier <yann.gautier@st.com>
---
 bl2/bl2_image_load_v2.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/bl2/bl2_image_load_v2.c b/bl2/bl2_image_load_v2.c
index 48c9beca6..4fb0e030d 100644
--- a/bl2/bl2_image_load_v2.c
+++ b/bl2/bl2_image_load_v2.c
@@ -74,17 +74,17 @@ struct entry_point_info *bl2_load_images(void)
 				      bl2_node_info->image_id, err);
 				plat_error_handler(err);
 			}
+
+			/* Allow platform to handle image information. */
+			err = bl2_plat_handle_post_image_load(bl2_node_info->image_id);
+			if (err != 0) {
+				ERROR("BL2: Failure in post image load handling (%i)\n", err);
+				plat_error_handler(err);
+			}
 		} else {
 			INFO("BL2: Skip loading image id %d\n", bl2_node_info->image_id);
 		}
 
-		/* Allow platform to handle image information. */
-		err = bl2_plat_handle_post_image_load(bl2_node_info->image_id);
-		if (err != 0) {
-			ERROR("BL2: Failure in post image load handling (%i)\n", err);
-			plat_error_handler(err);
-		}
-
 		/* Go to next image */
 		bl2_node_info = bl2_node_info->next_load_info;
 	}
-- 
GitLab