Skip to content

Commit

Permalink
kconfig: fix segfault when detecting recursive dependency
Browse files Browse the repository at this point in the history
Following sample Kconfig generated a segfault:

config FOO
        bool
        select PERF_EVENTS if HAVE_HW_BREAKPOINT

config PERF_EVENTS
        bool

config HAVE_HW_BREAKPOINT
        bool
        depends on PERF_EVENTS

Fix by reverting back to a valid property if there was no
property on the stack of symbols.

The above pattern were seen in sh Kconfig.
A fix for the Kconfig file has been sent to the sh folks.

Signed-off-by: Sam Ravnborg <[email protected]>
Signed-off-by: Michal Marek <[email protected]>
  • Loading branch information
sravnborg authored and michal42 committed Aug 14, 2010
1 parent 84062dd commit 3643f84
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions scripts/kconfig/symbol.c
Original file line number Diff line number Diff line change
Expand Up @@ -937,6 +937,8 @@ static void sym_check_print_recursive(struct symbol *last_sym)
sym = stack->sym;
next_sym = stack->next ? stack->next->sym : last_sym;
prop = stack->prop;
if (prop == NULL)
prop = stack->sym->prop;

/* for choice values find the menu entry (used below) */
if (sym_is_choice(sym) || sym_is_choice_value(sym)) {
Expand Down

0 comments on commit 3643f84

Please sign in to comment.