summaryrefslogtreecommitdiff
path: root/arch/powerpc/tools
diff options
context:
space:
mode:
authorAlexey Kardashevskiy <aik@ozlabs.ru>2020-06-02 05:56:12 +0300
committerMichael Ellerman <mpe@ellerman.id.au>2020-08-27 10:41:44 +0300
commitb460b512417ae9c8b51a3bdcc09020cd6c60ff69 (patch)
tree00437f714f58621dd249d2dc50b49b197a1f3c00 /arch/powerpc/tools
parentb91eb5182405b01a8aeb42e9b5207831767e97ee (diff)
downloadlinux-b460b512417ae9c8b51a3bdcc09020cd6c60ff69.tar.xz
powerpc/perf: Fix crashes with generic_compat_pmu & BHRB
The bhrb_filter_map ("The Branch History Rolling Buffer") callback is only defined in raw CPUs' power_pmu structs. The "architected" CPUs use generic_compat_pmu, which does not have this callback, and crashes occur if a user tries to enable branch stack for an event. This add a NULL pointer check for bhrb_filter_map() which behaves as if the callback returned an error. This does not add the same check for config_bhrb() as the only caller checks for cpuhw->bhrb_users which remains zero if bhrb_filter_map==0. Fixes: be80e758d0c2 ("powerpc/perf: Add generic compat mode pmu driver") Cc: stable@vger.kernel.org # v5.2+ Signed-off-by: Alexey Kardashevskiy <aik@ozlabs.ru> Reviewed-by: Madhavan Srinivasan <maddy@linux.ibm.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20200602025612.62707-1-aik@ozlabs.ru
Diffstat (limited to 'arch/powerpc/tools')
0 files changed, 0 insertions, 0 deletions