2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-19 02:34:01 +08:00

perfcounters: fix refcounting bug

don't kfree in use counters.

Running...

	while true; do perfstat -e 1 -c true; done

...on all cores for a while doesn't seem to be eating ram, and my oops
is gone.

Signed-off-by: Mike Galbraith <efault@gmx.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
Mike Galbraith 2009-01-29 14:06:52 +01:00 committed by Ingo Molnar
parent bb3f0b59ad
commit 65d370862f

View File

@ -1934,7 +1934,8 @@ __perf_counter_exit_task(struct task_struct *child,
}
}
kfree(child_counter);
if (!child_counter->filp || !atomic_long_read(&child_counter->filp->f_count))
kfree(child_counter);
}
/*