perf/hwbp: Fix cleanup in case of kzalloc failure
PATCH 1/1 perf/hwbp: Fix cleanup in case of kzalloc failure
Obviously this is a typo and could result in memory leaks if kzalloc fails on a given cpu.
Signed-off-by Daniel Baluta <[email protected]>
--- kernel/events/hw_breakpoint.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
kernel/events/hw_breakpoint.c +1 -1
@@ -676,7 +676,7 @@ int __init init_hw_breakpoint(void) err_alloc:for_each_possible_cpu (err_cpu) {for (i =0 ; i <TYPE_MAX ; i++) -kfree (per_cpu (nr_task_bp_pinned[i], cpu)); +kfree (per_cpu (nr_task_bp_pinned[i], err_cpu));if (err_cpu == cpu)break ; }
Signature · 1 line
1.7.5.4
2013/2/6 Daniel Baluta <[email protected]>:
Quoted 4 lines
Obviously this is a typo and could result in memory leaks if kzalloc fails on a given cpu.
Signed-off-by Daniel Baluta <[email protected]>
Good catch!
Quoted 20 lines
--- kernel/events/hw_breakpoint.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)kernel/events/hw_breakpoint.c +1
-2@@ -676,7 +676,7 @@ int __init init_hw_breakpoint(void) err_alloc:for_each_possible_cpu (err_cpu) {for (i =0 ; i <TYPE_MAX ; i++) -kfree (per_cpu (nr_task_bp_pinned[i], cpu)); +kfree (per_cpu (nr_task_bp_pinned[i], err_cpu));if (err_cpu == cpu)break ; } --1.7.5.4
[tip:perf/urgent] perf/hwbp: Fix cleanup in case of kzalloc() failure
In reply to Daniel BalutaCommit-ID: e97cbe3edf7d88aad4c21dd3de124d9f9d039881 Gitweb: http://git.kernel.org/tip/e97cbe3edf7d88aad4c21dd3de124d9f9d039881 Author: Daniel Baluta <[email protected]> AuthorDate: Wed, 6 Feb 2013 23:29:20 +0200 Committer: Ingo Molnar <[email protected]> CommitDate: Thu, 7 Feb 2013 11:52:19 +0100
perf/hwbp: Fix cleanup in case of kzalloc() failure
Obviously this is a typo and could result in memory leaks if kzalloc fails on a given cpu.
Signed-off-by Daniel Baluta <[email protected]>
Signed-off-by Ingo Molnar <[email protected]>
--- kernel/events/hw_breakpoint.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/events/hw_breakpoint.c +1 -1
@@ -676,7 +676,7 @@ int __init init_hw_breakpoint(void) err_alloc:for_each_possible_cpu (err_cpu) {for (i =0 ; i <TYPE_MAX ; i++) -kfree (per_cpu (nr_task_bp_pinned[i], cpu)); +kfree (per_cpu (nr_task_bp_pinned[i], err_cpu));if (err_cpu == cpu)break ; }
Commit-ID: 02e176af92f3e2e9ec3a48792036566af2dcd534 Gitweb: http://git.kernel.org/tip/02e176af92f3e2e9ec3a48792036566af2dcd534 Author: Daniel Baluta <[email protected]> AuthorDate: Wed, 6 Feb 2013 23:29:20 +0200 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Thu, 14 Feb 2013 17:06:39 -0300
perf/hwbp: Fix cleanup in case of kzalloc failure
Obviously this is a typo and could result in memory leaks if kzalloc fails on a given cpu.
Signed-off-by Daniel Baluta <[email protected]>
Cc Frederic Weisbecker <[email protected]>
Cc Ingo Molnar <[email protected]>
Cc Paul Mackerras <[email protected]>
Cc Peter Zijlstra <[email protected]>
Signed-off-by Arnaldo Carvalho de Melo <[email protected]>
--- kernel/events/hw_breakpoint.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/events/hw_breakpoint.c +1 -1
@@ -676,7 +676,7 @@ int __init init_hw_breakpoint(void) err_alloc:for_each_possible_cpu (err_cpu) {for (i =0 ; i <TYPE_MAX ; i++) -kfree (per_cpu (nr_task_bp_pinned[i], cpu)); +kfree (per_cpu (nr_task_bp_pinned[i], err_cpu));if (err_cpu == cpu)break ; }