mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
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 <[email protected]> Signed-off-by: Arnd Bergmann <[email protected]> Acked-by: Robert Richter <[email protected]> Signed-off-by: Paul Mackerras <[email protected]>
This commit is contained in:
parent
2bb2e1db90
commit
f4156d1cd1
2 changed files with 5 additions and 1 deletions
|
|
@ -38,8 +38,10 @@ void free_cpu_buffers(void)
|
|||
{
|
||||
int i;
|
||||
|
||||
for_each_online_cpu(i)
|
||||
for_each_online_cpu(i) {
|
||||
vfree(per_cpu(cpu_buffer, i).buffer);
|
||||
per_cpu(cpu_buffer, i).buffer = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
int alloc_cpu_buffers(void)
|
||||
|
|
|
|||
|
|
@ -93,6 +93,8 @@ out:
|
|||
void free_event_buffer(void)
|
||||
{
|
||||
vfree(event_buffer);
|
||||
|
||||
event_buffer = NULL;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue