Переглянути джерело

image: Load the correct configuration in fit_check_sign

At present bootm_host_load_images() is passed the configuration that has
been verified, but ignores it and just uses the default configuration.
This may not be the same.

Update this function to use the selected configuration.

Signed-off-by: Simon Glass <sjg@chromium.org>
Simon Glass 4 роки тому
батько
коміт
8a9d03732e
1 змінених файлів з 4 додано та 2 видалено
  1. 4 2
      common/bootm.c

+ 4 - 2
common/bootm.c

@@ -819,7 +819,8 @@ void __weak switch_to_non_secure_mode(void)
 #else /* USE_HOSTCC */
 #else /* USE_HOSTCC */
 
 
 #if defined(CONFIG_FIT_SIGNATURE)
 #if defined(CONFIG_FIT_SIGNATURE)
-static int bootm_host_load_image(const void *fit, int req_image_type)
+static int bootm_host_load_image(const void *fit, int req_image_type,
+				 int cfg_noffset)
 {
 {
 	const char *fit_uname_config = NULL;
 	const char *fit_uname_config = NULL;
 	ulong data, len;
 	ulong data, len;
@@ -831,6 +832,7 @@ static int bootm_host_load_image(const void *fit, int req_image_type)
 	void *load_buf;
 	void *load_buf;
 	int ret;
 	int ret;
 
 
+	fit_uname_config = fdt_get_name(fit, cfg_noffset, NULL);
 	memset(&images, '\0', sizeof(images));
 	memset(&images, '\0', sizeof(images));
 	images.verify = 1;
 	images.verify = 1;
 	noffset = fit_image_load(&images, (ulong)fit,
 	noffset = fit_image_load(&images, (ulong)fit,
@@ -878,7 +880,7 @@ int bootm_host_load_images(const void *fit, int cfg_noffset)
 	for (i = 0; i < ARRAY_SIZE(image_types); i++) {
 	for (i = 0; i < ARRAY_SIZE(image_types); i++) {
 		int ret;
 		int ret;
 
 
-		ret = bootm_host_load_image(fit, image_types[i]);
+		ret = bootm_host_load_image(fit, image_types[i], cfg_noffset);
 		if (!err && ret && ret != -ENOENT)
 		if (!err && ret && ret != -ENOENT)
 			err = ret;
 			err = ret;
 	}
 	}