diff options
author | Benjamin Poirier <bpoirier@suse.de> | 2013-04-15 16:13:50 +0200 |
---|---|---|
committer | Yann E. MORIN <yann.morin.1998@free.fr> | 2013-04-16 21:59:28 +0200 |
commit | edb749f4390b3c1604233dc7c4fb0361f472e712 (patch) | |
tree | 2fc01bf1af715d291ad031b30e82e3cfac1e7f47 /scripts/kconfig/list.h | |
parent | merge_config.sh: Avoid creating unnessary source softlinks (diff) | |
download | linux-edb749f4390b3c1604233dc7c4fb0361f472e712.tar.xz linux-edb749f4390b3c1604233dc7c4fb0361f472e712.zip |
menuconfig: Fix memory leak introduced by jump keys feature
Fixes the memory leak of struct jump_key allocated in get_prompt_str()
Signed-off-by: Benjamin Poirier <bpoirier@suse.de>
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>
Cc: stable@vger.kernel.org
Diffstat (limited to 'scripts/kconfig/list.h')
-rw-r--r-- | scripts/kconfig/list.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/scripts/kconfig/list.h b/scripts/kconfig/list.h index 0ae730be5f49..b87206cc92f4 100644 --- a/scripts/kconfig/list.h +++ b/scripts/kconfig/list.h @@ -51,6 +51,19 @@ struct list_head { pos = list_entry(pos->member.next, typeof(*pos), member)) /** + * list_for_each_entry_safe - iterate over list of given type safe against removal of list entry + * @pos: the type * to use as a loop cursor. + * @n: another type * to use as temporary storage + * @head: the head for your list. + * @member: the name of the list_struct within the struct. + */ +#define list_for_each_entry_safe(pos, n, head, member) \ + for (pos = list_entry((head)->next, typeof(*pos), member), \ + n = list_entry(pos->member.next, typeof(*pos), member); \ + &pos->member != (head); \ + pos = n, n = list_entry(n->member.next, typeof(*n), member)) + +/** * list_empty - tests whether a list is empty * @head: the list to test. */ |