]> git.baikalelectronics.ru Git - kernel.git/commit
perf/x86/intel/pt: Clean up the control flow in pt_pmu_hw_init()
authorIngo Molnar <mingo@kernel.org>
Sun, 12 Apr 2015 09:11:21 +0000 (11:11 +0200)
committerIngo Molnar <mingo@kernel.org>
Sun, 12 Apr 2015 09:21:15 +0000 (11:21 +0200)
commitd0597a4af5b2be1c3a48320d8018f45ac007942d
tree8dcc666fb88b9e6f472ccad4fed9f1d57d538938
parentb6ffb477f415939f38484436ff5a62a6b91b6b40
perf/x86/intel/pt: Clean up the control flow in pt_pmu_hw_init()

Dan Carpenter pointed out that the control flow in pt_pmu_hw_init()
is a bit messy: for example the kfree(de_attrs) is entirely
superfluous.

Another problem is the inconsistent mixing of label based and
direct return error handling.

Add modern, label based error handling instead and clean up the code
a bit as well.

Note that we'll still do a kfree(NULL) in the normal case - this does
not matter as this is an init path and kfree() returns early if it
sees a NULL.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/20150409090805.GG17605@mwanda
Signed-off-by: Ingo Molnar <mingo@kernel.org>
arch/x86/kernel/cpu/perf_event_intel_pt.c