powerpc/perf: Return accordingly on invalid chip-id in
authorAnju T Sudhakar <anju@linux.vnet.ibm.com>
Tue, 27 Nov 2018 08:24:52 +0000 (13:54 +0530)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 31 May 2019 13:46:10 +0000 (06:46 -0700)
commit741853944fea8927781e2d659c9cb2dc888a92ec
tree26203876f75d43ff1ebe364e6ee1ca7497954dfb
parent49c0fa1f35c1893051696318cfc8adb409bdaec3
powerpc/perf: Return accordingly on invalid chip-id in

[ Upstream commit a913e5e8b43be1d3897a141ce61c1ec071cad89c ]

Nest hardware counter memory resides in a per-chip reserve-memory.
During nest_imc_event_init(), chip-id of the event-cpu is considered to
calculate the base memory addresss for that cpu. Return, proper error
condition if the chip_id calculated is invalid.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Fixes: 885dcd709ba91 ("powerpc/perf: Add nest IMC PMU support")
Reviewed-by: Madhavan Srinivasan <maddy@linux.vnet.ibm.com>
Signed-off-by: Anju T Sudhakar <anju@linux.vnet.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/powerpc/perf/imc-pmu.c