summaryrefslogtreecommitdiffstats
path: root/scripts/kconfig/menu.c
diff options
context:
space:
mode:
authorMark Brown <broonie@linaro.org>2013-06-14 10:16:06 +0100
committerMark Brown <broonie@linaro.org>2013-06-14 10:16:06 +0100
commit384b8345589cbbb18a99ce1b112da90c58c802e8 (patch)
tree51fee39fa19adad6b24fb90123e7a0ca3159c9c5 /scripts/kconfig/menu.c
parent9c24b1672283644adf871244771ebf387dd73f90 (diff)
parent2e7ee15ced914e109a1a5b6dfcd463d846a13bd5 (diff)
Merge branch 'fix/wm8962' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-wm8962
Conflicts: sound/soc/codecs/wm8962.c
Diffstat (limited to 'scripts/kconfig/menu.c')
-rw-r--r--scripts/kconfig/menu.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/scripts/kconfig/menu.c b/scripts/kconfig/menu.c
index b5c7d90df9d..fd3f0180e08 100644
--- a/scripts/kconfig/menu.c
+++ b/scripts/kconfig/menu.c
@@ -146,11 +146,24 @@ struct property *menu_add_prop(enum prop_type type, char *prompt, struct expr *e
struct menu *menu = current_entry;
while ((menu = menu->parent) != NULL) {
+ struct expr *dup_expr;
+
if (!menu->visibility)
continue;
+ /*
+ * Do not add a reference to the
+ * menu's visibility expression but
+ * use a copy of it. Otherwise the
+ * expression reduction functions
+ * will modify expressions that have
+ * multiple references which can
+ * cause unwanted side effects.
+ */
+ dup_expr = expr_copy(menu->visibility);
+
prop->visible.expr
= expr_alloc_and(prop->visible.expr,
- menu->visibility);
+ dup_expr);
}
}