perf_counter: Fix return value from dummy hw_perf_counter_init
commitff6f05416ece2caec1a7a1f8180d6598e0ab9272
authorPaul Mackerras <paulus@samba.org>
Fri, 9 Jan 2009 05:19:25 +0000 (9 16:19 +1100)
committerPaul Mackerras <paulus@samba.org>
Fri, 9 Jan 2009 05:19:25 +0000 (9 16:19 +1100)
tree31ab967c5da814cc27dc0d9f8514f3af5dcd49ac
parente1df957670aef74ffd9a4ad93e6d2c90bf6b4845
perf_counter: Fix return value from dummy hw_perf_counter_init

Impact: fix oops-causing bug

Currently, if you try to use perf_counters on an architecture that has
no hardware support, and you select an event that doesn't map to any of
the defined software counters, you get an oops rather than an error.
This is because the dummy hw_perf_counter_init returns ERR_PTR(-EINVAL)
but the caller (perf_counter_alloc) only tests for NULL.

This makes the dummy hw_perf_counter_init return NULL instead.

Signed-off-by: Paul Mackerras <paulus@samba.org>
kernel/perf_counter.c