spl: fit: not allow default configure node miss

Signed-off-by: Joseph Chen <chenjh@rock-chips.com>
Change-Id: I07af21fdc371dcfdc55115febfc3e99ff41ee8d4
This commit is contained in:
Joseph Chen 2020-07-13 19:48:22 +08:00
parent 1ddd141a3e
commit a7560f55a3
1 changed files with 10 additions and 7 deletions

View File

@ -413,15 +413,18 @@ static int spl_internal_load_simple_fit(struct spl_image_info *spl_image,
int conf_noffset;
conf_noffset = fit_conf_get_node(fit, NULL);
if (conf_noffset > 0) {
ret = fit_config_verify(fit, conf_noffset);
if (ret) {
printf("fit verify configure failed, ret=%d\n", ret);
return ret;
}
printf("\n");
if (conf_noffset <= 0) {
printf("No default config node\n");
return -EINVAL;
}
ret = fit_config_verify(fit, conf_noffset);
if (ret) {
printf("fit verify configure failed, ret=%d\n", ret);
return ret;
}
printf("\n");
#ifdef CONFIG_SPL_FIT_ROLLBACK_PROTECT
uint32_t this_index, min_index;