diff options
author | Carl Love <cel@us.ibm.com> | 2008-08-11 03:25:43 -0400 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2008-08-25 20:24:46 -0400 |
commit | f4156d1cd1dc260cca767a6c0636625f05446799 (patch) | |
tree | f0802db39246d371908a43dc992823feb82fecd8 /drivers/oprofile/cpu_buffer.c | |
parent | 2bb2e1db906e6e139636271d2cf46466d9e84005 (diff) |
powerpc/cell/oprofile: Avoid double vfree of profile buffer
If an error occurs on opcontrol start, the event and per cpu buffers
are released. If later opcontrol shutdown is called then the free
function will be called again to free buffers that no longer
exist. This results in a kernel oops. The following changes
prevent the call to delete buffers that don't exist.
Signed-off-by: Carl Love <carll@us.ibm.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Robert Richter <robert.richter@amd.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'drivers/oprofile/cpu_buffer.c')
-rw-r--r-- | drivers/oprofile/cpu_buffer.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/oprofile/cpu_buffer.c b/drivers/oprofile/cpu_buffer.c index 2450b3a393ff..7ba78e6d210e 100644 --- a/drivers/oprofile/cpu_buffer.c +++ b/drivers/oprofile/cpu_buffer.c | |||
@@ -38,8 +38,10 @@ void free_cpu_buffers(void) | |||
38 | { | 38 | { |
39 | int i; | 39 | int i; |
40 | 40 | ||
41 | for_each_online_cpu(i) | 41 | for_each_online_cpu(i) { |
42 | vfree(per_cpu(cpu_buffer, i).buffer); | 42 | vfree(per_cpu(cpu_buffer, i).buffer); |
43 | per_cpu(cpu_buffer, i).buffer = NULL; | ||
44 | } | ||
43 | } | 45 | } |
44 | 46 | ||
45 | int alloc_cpu_buffers(void) | 47 | int alloc_cpu_buffers(void) |