diff options
author | Frederic Weisbecker <fweisbec@gmail.com> | 2009-11-25 23:35:42 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-11-26 03:29:21 -0500 |
commit | 605bfaee9078cd0b01d83402315389839ee4bb5c (patch) | |
tree | 35c3af269b37347b689b3b212fc99d4ae9f719e5 /kernel/hw_breakpoint.c | |
parent | c6567f642e20bcc79abed030f44be5b0d6da2ded (diff) |
hw-breakpoints: Simplify error handling in breakpoint creation requests
This simplifies the error handling when we create a breakpoint.
We don't need to check the NULL return value corner case anymore
since we have improved perf_event_create_kernel_counter() to
always return an error code in the failure case.
Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Prasad <prasad@linux.vnet.ibm.com>
LKML-Reference: <1259210142-5714-3-git-send-regression-fweisbec@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/hw_breakpoint.c')
-rw-r--r-- | kernel/hw_breakpoint.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/hw_breakpoint.c b/kernel/hw_breakpoint.c index 06d372fc026d..dd3fb4a999d3 100644 --- a/kernel/hw_breakpoint.c +++ b/kernel/hw_breakpoint.c | |||
@@ -442,7 +442,7 @@ register_wide_hw_breakpoint(unsigned long addr, | |||
442 | 442 | ||
443 | *pevent = bp; | 443 | *pevent = bp; |
444 | 444 | ||
445 | if (IS_ERR(bp) || !bp) { | 445 | if (IS_ERR(bp)) { |
446 | err = PTR_ERR(bp); | 446 | err = PTR_ERR(bp); |
447 | goto fail; | 447 | goto fail; |
448 | } | 448 | } |
@@ -453,7 +453,7 @@ register_wide_hw_breakpoint(unsigned long addr, | |||
453 | fail: | 453 | fail: |
454 | for_each_possible_cpu(cpu) { | 454 | for_each_possible_cpu(cpu) { |
455 | pevent = per_cpu_ptr(cpu_events, cpu); | 455 | pevent = per_cpu_ptr(cpu_events, cpu); |
456 | if (IS_ERR(*pevent) || !*pevent) | 456 | if (IS_ERR(*pevent)) |
457 | break; | 457 | break; |
458 | unregister_hw_breakpoint(*pevent); | 458 | unregister_hw_breakpoint(*pevent); |
459 | } | 459 | } |