From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
stable@vger.kernel.org, Benjamin Poirier <bpoirier@suse.de>,
"Yann E. MORIN" <yann.morin.1998@free.fr>
Subject: [ 11/73] menuconfig: Fix memory leak introduced by jump keys feature
Date: Thu, 9 May 2013 15:25:01 -0700 [thread overview]
Message-ID: <20130509222527.655098101@linuxfoundation.org> (raw)
In-Reply-To: <20130509222526.480204972@linuxfoundation.org>
3.9-stable review patch. If anyone has any objections, please let me know.
------------------
From: Benjamin Poirier <bpoirier@suse.de>
commit edb749f4390b3c1604233dc7c4fb0361f472e712 upstream.
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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
scripts/kconfig/list.h | 13 +++++++++++++
scripts/kconfig/mconf.c | 3 +++
2 files changed, 16 insertions(+)
--- 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.
*/
--- a/scripts/kconfig/mconf.c
+++ b/scripts/kconfig/mconf.c
@@ -389,6 +389,7 @@ again:
.targets = targets,
.keys = keys,
};
+ struct jump_key *pos, *tmp;
res = get_relations_str(sym_arr, &head);
dres = show_textbox_ext(_("Search Results"), (char *)
@@ -402,6 +403,8 @@ again:
again = true;
}
str_free(&res);
+ list_for_each_entry_safe(pos, tmp, &head, entries)
+ free(pos);
} while (again);
free(sym_arr);
str_free(&title);
next prev parent reply other threads:[~2013-05-09 22:25 UTC|newest]
Thread overview: 78+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-09 22:24 [ 00/73] 3.9.2-stable review Greg Kroah-Hartman
2013-05-09 22:24 ` [ 01/73] xen/arm: actually pass a non-NULL percpu pointer to request_percpu_irq Greg Kroah-Hartman
2013-05-09 22:24 ` [ 02/73] powerpc: Emulate non privileged DSCR read and write Greg Kroah-Hartman
2013-05-09 22:24 ` [ 03/73] powerpc/tm: Fix null pointer deference in flush_hash_page Greg Kroah-Hartman
2013-05-09 22:24 ` [ 04/73] powerpc: fix numa distance for form0 device tree Greg Kroah-Hartman
2013-05-09 22:24 ` [ 05/73] pwm: spear: Fix checking return value of clk_enable() and clk_prepare() Greg Kroah-Hartman
2013-05-09 22:24 ` [ 06/73] autofs - remove autofs dentry mount check Greg Kroah-Hartman
2013-05-09 22:24 ` [ 07/73] rpmsg: fix kconfig dependencies for VIRTIO Greg Kroah-Hartman
2013-05-09 22:24 ` [ 08/73] remoteproc: " Greg Kroah-Hartman
2013-05-09 22:24 ` [ 09/73] hugetlbfs: fix mmap failure in unaligned size request Greg Kroah-Hartman
2013-05-09 22:25 ` [ 10/73] iommu/amd: Properly initialize irq-table lock Greg Kroah-Hartman
2013-05-09 22:25 ` Greg Kroah-Hartman [this message]
2013-05-09 22:25 ` [ 12/73] net/eth/ibmveth: Fixup retrieval of MAC address Greg Kroah-Hartman
2013-05-09 22:25 ` [ 13/73] perf/x86/intel: Add support for IvyBridge model 58 Uncore Greg Kroah-Hartman
2013-05-09 22:25 ` [ 14/73] perf/x86/intel: Fix unintended variable name reuse Greg Kroah-Hartman
2013-05-09 22:25 ` [ 15/73] perf/x86: Blacklist all MEM_*_RETIRED events for Ivy Bridge Greg Kroah-Hartman
2013-05-09 22:25 ` [ 16/73] perf/x86/intel/lbr: Fix LBR filter Greg Kroah-Hartman
2013-05-09 22:25 ` [ 17/73] perf/x86/intel/lbr: Demand proper privileges for PERF_SAMPLE_BRANCH_KERNEL Greg Kroah-Hartman
2013-05-09 22:25 ` [ 18/73] ipvs: ip_vs_sip_fill_param() BUG: bad check of return value Greg Kroah-Hartman
2013-05-09 22:25 ` [ 19/73] ext4: add check for inodes_count overflow in new resize ioctl Greg Kroah-Hartman
2013-05-09 22:25 ` [ 20/73] MODSIGN: do not send garbage to stderr when enabling modules signature Greg Kroah-Hartman
2013-05-09 22:25 ` [ 21/73] r8169: fix 8168evl frame padding Greg Kroah-Hartman
2013-05-09 22:25 ` [ 22/73] RDMA/cxgb4: Fix SQ allocation when on-chip SQ is disabled Greg Kroah-Hartman
2013-05-09 22:25 ` [ 23/73] arm64: Ignore the write ESR flag on cache maintenance faults Greg Kroah-Hartman
2013-05-09 22:25 ` [ 24/73] blkcg: fix "scheduling while atomic" in blk_queue_bypass_start Greg Kroah-Hartman
2013-05-09 22:25 ` [ 25/73] block: fix max discard sectors limit Greg Kroah-Hartman
2013-05-09 22:25 ` [ 26/73] drm/cirrus: deal with bo reserve fail in dirty update path Greg Kroah-Hartman
2013-05-09 22:25 ` [ 27/73] drm/mgag200: " Greg Kroah-Hartman
2013-05-09 22:25 ` [ 28/73] drm/gma500: fix backlight hotkeys behaviour on netbooks Greg Kroah-Hartman
2013-05-09 22:25 ` [ 29/73] drm: prime: fix refcounting on the dmabuf import error path Greg Kroah-Hartman
2013-05-09 22:25 ` [ 30/73] drm/prime: keep a reference from the handle to exported dma-buf (v6) Greg Kroah-Hartman
2013-05-09 22:25 ` [ 31/73] drm/ast: deal with bo reserve fail in dirty update path Greg Kroah-Hartman
2013-05-09 22:25 ` [ 32/73] drm/i915: Fix sdvo connector get_hw_state function Greg Kroah-Hartman
2013-05-09 22:25 ` [ 33/73] drm/i915: Add no-lvds quirk for Fujitsu Esprimo Q900 Greg Kroah-Hartman
2013-05-09 22:25 ` [ 34/73] drm/i915: Fix SDVO connector and encoder get_hw_state functions Greg Kroah-Hartman
2013-05-09 22:25 ` [ 35/73] drm/i915: Workaround incoherence between fences and LLC across multiple CPUs Greg Kroah-Hartman
2013-05-09 22:25 ` [ 36/73] drm/i915: Use MLC (l3$) for context objects Greg Kroah-Hartman
2013-05-09 22:25 ` [ 37/73] drm/i915: set CPT FDI RX polarity bits based on VBT Greg Kroah-Hartman
2013-05-09 22:25 ` [ 38/73] drm/i915: dont check inconsistent modeset state when force-restoring Greg Kroah-Hartman
2013-05-09 22:25 ` [ 39/73] drm/i915: ensure single initialization and cleanup of backlight device Greg Kroah-Hartman
2013-05-09 22:25 ` [ 40/73] drm/i915: dont intel_crt_init on any ULT machines Greg Kroah-Hartman
2013-05-09 22:25 ` [ 41/73] drm/i915: Fixup Oops in the pipe config computation Greg Kroah-Hartman
2013-05-09 22:25 ` [ 42/73] drm/i915: Fall back to bit banging mode for DVO transmitter detection Greg Kroah-Hartman
2013-05-09 22:25 ` [ 43/73] drm/i915: correct the calculation of first_pd_entry_in_global_pt Greg Kroah-Hartman
2013-05-09 22:25 ` [ 44/73] drm/radeon: dont use get_engine_clock() on APUs Greg Kroah-Hartman
2013-05-09 22:25 ` [ 45/73] drm/radeon: use frac fb div on RS780/RS880 Greg Kroah-Hartman
2013-05-09 22:25 ` [ 46/73] drm/radeon: fix typo in rv515_mc_resume() Greg Kroah-Hartman
2013-05-09 22:25 ` [ 47/73] drm/radeon/dce6: add missing display reg for tiling setup Greg Kroah-Hartman
2013-05-09 22:25 ` [ 48/73] drm/radeon: update wait_for_vblank for r5xx-r7xx Greg Kroah-Hartman
2013-05-09 22:25 ` [ 49/73] drm/radeon: update wait_for_vblank for evergreen+ Greg Kroah-Hartman
2013-05-09 22:25 ` [ 50/73] drm/radeon: properly lock disp in mc_stop/resume " Greg Kroah-Hartman
2013-05-09 22:25 ` [ 51/73] drm/radeon: properly lock disp in mc_stop/resume for r5xx-r7xx Greg Kroah-Hartman
2013-05-09 22:25 ` [ 52/73] drm/radeon: update wait_for_vblank for r1xx-r4xx Greg Kroah-Hartman
2013-05-09 22:25 ` [ 53/73] drm/radeon: disable the crtcs in mc_stop (evergreen+) (v2) Greg Kroah-Hartman
2013-05-09 22:25 ` [ 54/73] drm/radeon: add some new SI PCI ids Greg Kroah-Hartman
2013-05-09 22:25 ` [ 55/73] drm/radeon/evergreen+: dont enable HPD interrupts on eDP/LVDS Greg Kroah-Hartman
2013-05-09 22:25 ` [ 56/73] drm/radeon: cleanup properly if mmio mapping fails Greg Kroah-Hartman
2013-05-09 22:25 ` [ 57/73] drm/radeon: fix hdmi mode enable on RS600/RS690/RS740 Greg Kroah-Hartman
2013-05-09 22:25 ` [ 58/73] drm/radeon: fix typo in si_select_se_sh() Greg Kroah-Hartman
2013-05-09 22:25 ` [ 59/73] drm/radeon: Always flush the VM Greg Kroah-Hartman
2013-05-09 22:25 ` [ 60/73] drm/radeon: disable the crtcs in mc_stop (r5xx-r7xx) (v2) Greg Kroah-Hartman
2013-05-09 22:25 ` [ 61/73] drm/radeon: fix endian bugs in atom_allocate_fb_scratch() Greg Kroah-Hartman
2013-05-09 22:25 ` [ 62/73] drm/radeon: fix possible segfault when parsing pm tables Greg Kroah-Hartman
2013-05-09 22:25 ` [ 63/73] drm/radeon: add new richland pci ids Greg Kroah-Hartman
2013-05-09 22:25 ` [ 64/73] drm/radeon: fix handling of v6 power tables Greg Kroah-Hartman
2013-05-09 22:25 ` [ 65/73] drm/tilcdc: Fix an incorrect condition Greg Kroah-Hartman
2013-05-09 22:25 ` [ 66/73] tracing: Fix ftrace_dump() Greg Kroah-Hartman
2013-05-09 22:25 ` [ 67/73] Btrfs: compare relevant parts of delayed tree refs Greg Kroah-Hartman
2013-05-09 22:25 ` [ 68/73] Btrfs: fix extent logging with O_DIRECT into prealloc Greg Kroah-Hartman
2013-05-09 22:25 ` [ 69/73] EDAC: Dont give write permission to read-only files Greg Kroah-Hartman
2013-05-09 22:26 ` [ 70/73] PCI: Delay final fixups until resources are assigned Greg Kroah-Hartman
2013-05-09 22:26 ` [ 71/73] qmi_wwan/cdc_ether: add device IDs for Dell 5804 (Novatel E371) WWAN card Greg Kroah-Hartman
2013-05-09 22:26 ` [ 72/73] NFSv4.x: Fix handling of partially delegated locks Greg Kroah-Hartman
2013-05-09 22:26 ` [ 73/73] kernel/audit_tree.c: tree will leak memory when failure occurs in audit_trim_trees() Greg Kroah-Hartman
2013-05-10 15:23 ` [ 00/73] 3.9.2-stable review Shuah Khan
2013-05-10 15:28 ` Greg Kroah-Hartman
2013-05-11 5:26 ` Satoru Takeuchi
2013-05-11 13:53 ` Greg Kroah-Hartman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130509222527.655098101@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=bpoirier@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
--cc=yann.morin.1998@free.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox