public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH]
@ 2010-08-14 12:43 Sam Ravnborg
  2010-08-14 12:44 ` [PATCH] kconfig: fix segfault when detecting recursive dependency Sam Ravnborg
  0 siblings, 1 reply; 3+ messages in thread
From: Sam Ravnborg @ 2010-08-14 12:43 UTC (permalink / raw)
  To: Michal Marek, linux-kbuild, lkml

>From 705dbd8a31520722bda78e1bc731e2880f8df0ff Mon Sep 17 00:00:00 2001
From: Sam Ravnborg <sam@ravnborg.org>
Date: Sat, 14 Aug 2010 14:40:00 +0200
Subject: [PATCH] kconfig: fix segfault when detecting recursive dependency

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 <sam@ravnborg.org>
---
 scripts/kconfig/symbol.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c
index e95718f..943712c 100644
--- a/scripts/kconfig/symbol.c
+++ b/scripts/kconfig/symbol.c
@@ -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)) {
-- 
1.6.0.6


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH] kconfig: fix segfault when detecting recursive dependency
  2010-08-14 12:43 [PATCH] Sam Ravnborg
@ 2010-08-14 12:44 ` Sam Ravnborg
  2010-08-14 22:38   ` Michal Marek
  0 siblings, 1 reply; 3+ messages in thread
From: Sam Ravnborg @ 2010-08-14 12:44 UTC (permalink / raw)
  To: Michal Marek, linux-kbuild, lkml

>From 705dbd8a31520722bda78e1bc731e2880f8df0ff Mon Sep 17 00:00:00 2001
From: Sam Ravnborg <sam@ravnborg.org>
Date: Sat, 14 Aug 2010 14:40:00 +0200
Subject: [PATCH] kconfig: fix segfault when detecting recursive dependency

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 <sam@ravnborg.org>
---
 scripts/kconfig/symbol.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/scripts/kconfig/symbol.c b/scripts/kconfig/symbol.c
index e95718f..943712c 100644
--- a/scripts/kconfig/symbol.c
+++ b/scripts/kconfig/symbol.c
@@ -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)) {
-- 
1.6.0.6

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] kconfig: fix segfault when detecting recursive dependency
  2010-08-14 12:44 ` [PATCH] kconfig: fix segfault when detecting recursive dependency Sam Ravnborg
@ 2010-08-14 22:38   ` Michal Marek
  0 siblings, 0 replies; 3+ messages in thread
From: Michal Marek @ 2010-08-14 22:38 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: linux-kbuild, lkml

Dne 14.8.2010 14:44, Sam Ravnborg napsal(a):
> From 705dbd8a31520722bda78e1bc731e2880f8df0ff Mon Sep 17 00:00:00 2001
> From: Sam Ravnborg <sam@ravnborg.org>
> Date: Sat, 14 Aug 2010 14:40:00 +0200
> Subject: [PATCH] kconfig: fix segfault when detecting recursive dependency
> 
> 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.

Applied, thanks.

Michal

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-08-14 22:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-14 12:43 [PATCH] Sam Ravnborg
2010-08-14 12:44 ` [PATCH] kconfig: fix segfault when detecting recursive dependency Sam Ravnborg
2010-08-14 22:38   ` Michal Marek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox