summaryrefslogtreecommitdiff
path: root/boot
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2023-10-01 19:13:26 -0600
committerTom Rini <trini@konsulko.com>2023-10-11 15:43:55 -0400
commit408011c2a4b7a7f68cf55876252446a570b3827a (patch)
tree4a8a36eb553986ce87623d6ca67f4bfc524c8143 /boot
parent9767de7b468846963f134753592d64a817d160ee (diff)
downloadu-boot-408011c2a4b7a7f68cf55876252446a570b3827a.tar.gz
u-boot-408011c2a4b7a7f68cf55876252446a570b3827a.tar.bz2
u-boot-408011c2a4b7a7f68cf55876252446a570b3827a.zip
expo: Correct the logic for duplicate-ID detection
Update scene_txt_str() to account for the possibility that the passed-in str_id may be 0 Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'boot')
-rw-r--r--boot/scene.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/boot/scene.c b/boot/scene.c
index 9c4466c1a4..8e5d3aa7dc 100644
--- a/boot/scene.c
+++ b/boot/scene.c
@@ -176,8 +176,9 @@ int scene_txt_str(struct scene *scn, const char *name, uint id, uint str_id,
ret = expo_str(scn->expo, name, str_id, str);
if (ret < 0)
return log_msg_ret("str", ret);
- else if (ret != str_id)
+ if (str_id && ret != str_id)
return log_msg_ret("id", -EEXIST);
+ str_id = ret;
ret = scene_obj_add(scn, name, id, SCENEOBJT_TEXT,
sizeof(struct scene_obj_txt),