x86: fix oprofile double free
authorChris Wright <chrisw@sous-sol.org>
Fri, 1 Jun 2007 07:46:39 +0000 (00:46 -0700)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Fri, 1 Jun 2007 15:18:28 +0000 (08:18 -0700)
commit0939c17c7bcf1c838bea4445b80a6966809a438f
tree3d93789babaab344aa9c6840e267ffe34caadc6c
parent24faa9eef876d39e0826a36f31ae0e8b0eeb9835
x86: fix oprofile double free

Chuck reports that the recent fix from Andi to oprofile
6c977aad03a18019015035958c65b6729cd0574c introduces a double free.  Each
cpu's cpu_msrs is setup to point to cpu 0's, which causes free_msrs to free
cpu 0's pointers for_each_possible_cpu.  Rather than copy the pointers, do
a deep copy instead.

[acme@redhat.com: allocate_msrs() was using for_each_online_cpu()]
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
Cc: Andi Kleen <ak@suse.de>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Dave Jones <davej@redhat.com>
Cc: Chuck Ebbert <cebbert@redhat.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
arch/i386/oprofile/nmi_int.c