diff options
author | Dirk Gouders <dirk@gouders.net> | 2013-05-21 10:54:11 +0200 |
---|---|---|
committer | Yann E. MORIN <yann.morin.1998@free.fr> | 2013-05-30 00:14:01 +0200 |
commit | e983b7b17ad1a978e954e6aaa62cf12bfc747883 (patch) | |
tree | d03b6ef41719ff23f7228ce7f32c8a352b3bc070 /Documentation/cpu-freq/governors.txt | |
parent | 063f4661fde8c03c4c03f8a205071a52691c152e (diff) |
kconfig/menu.c: fix multiple references to expressions in menu_add_prop()
menu_add_prop() applies upper menus' visibilities to actual prompts
by AND-ing the prompts visibilities with the upper menus ones.
This creates a further reference to the menu's visibilities and when
the expression reduction functions do their work, they may remove or
modify expressions that have multiple references, thus causing
unpredictable side-effects.
The following example Kconfig constructs a case where this causes
problems: a menu and a prompt which's visibilities depend on the same
symbol. When invoking mconf with this Kconfig and pressing "Z" we
see a problem caused by a free'd expression still referenced by the
menu's visibility:
------------------------------------------------------------------------
mainmenu "Kconfig Testing Configuration"
config VISIBLE
def_bool n
config Placeholder
bool "Place holder"
menu "Invisible"
visible if VISIBLE
config TEST_VAR
bool "Test option" if VISIBLE
endmenu
------------------------------------------------------------------------
This patch fixes this problem by creating copies of the menu's
visibility expressions before AND-ing them with the prompt's one.
Signed-off-by: Dirk Gouders <dirk@gouders.net>
[yann.morin.1998@free.fr: move variable into its block-scope,
keep lines <80 chars, typo]
Tested-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Reviewed-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
Diffstat (limited to 'Documentation/cpu-freq/governors.txt')
0 files changed, 0 insertions, 0 deletions