summaryrefslogtreecommitdiff
path: root/scripts/kconfig/parser.y
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2024-10-06 11:34:55 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2024-10-06 11:34:55 -0700
commit2a130b7e1fcdd83633c4aa70998c314d7c38b476 (patch)
tree1d36f3c4565ba6d3c9e94b720fbf177ba036adbc /scripts/kconfig/parser.y
parentc8d9f2c7aa599dcebab63400f7eaa767629faf04 (diff)
parent82cb44308951ad4ce7a8500b9e025d27d7fb3526 (diff)
Merge tag 'kbuild-fixes-v6.12' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
Pull Kbuild fixes from Masahiro Yamada: - Move non-boot built-in DTBs to the .rodata section - Fix Kconfig bugs - Fix maint scripts in the linux-image Debian package - Import some list macros to scripts/include/ * tag 'kbuild-fixes-v6.12' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild: kbuild: deb-pkg: Remove blank first line from maint scripts kbuild: fix a typo dt_binding_schema -> dt_binding_schemas scripts: import more list macros kconfig: qconf: fix buffer overflow in debug links kconfig: qconf: move conf_read() before drawing tree pain kconfig: clear expr::val_is_valid when allocated kconfig: fix infinite loop in sym_calc_choice() kbuild: move non-boot built-in DTBs to .rodata section
Diffstat (limited to 'scripts/kconfig/parser.y')
-rw-r--r--scripts/kconfig/parser.y10
1 files changed, 8 insertions, 2 deletions
diff --git a/scripts/kconfig/parser.y b/scripts/kconfig/parser.y
index 1ad60f9e164e..bc43fb67c7c4 100644
--- a/scripts/kconfig/parser.y
+++ b/scripts/kconfig/parser.y
@@ -159,8 +159,14 @@ config_stmt: config_entry_start config_option_list
yynerrs++;
}
- list_add_tail(&current_entry->sym->choice_link,
- &current_choice->choice_members);
+ /*
+ * If the same symbol appears twice in a choice block, the list
+ * node would be added twice, leading to a broken linked list.
+ * list_empty() ensures that this symbol has not yet added.
+ */
+ if (list_empty(&current_entry->sym->choice_link))
+ list_add_tail(&current_entry->sym->choice_link,
+ &current_choice->choice_members);
}
printd(DEBUG_PARSE, "%s:%d:endconfig\n", cur_filename, cur_lineno);