[PATCH v2] powerpc/perf: Fix loop exit condition in nest_imc_event_init

Michael Ellerman patch-notifications at ellerman.id.au
Fri May 3 16:59:05 AEST 2019


On Tue, 2018-12-18 at 06:20:41 UTC, Anju T Sudhakar wrote:
> The data structure (i.e struct imc_mem_info) to hold the memory address
> information for nest imc units is allocated based on the number of nodes
> in the system.
> 
> nest_imc_event_init() traverse this struct array to calculate the memory
> base address for the event-cpu. If we fail to find a match for the event
> cpu's chip-id in imc_mem_info struct array, then the do-while loop will
> iterate until we crash.
> 
> Fix this by changing the loop exit condition based on the number of 
> non zero vbase elements in the array, since the allocation is done for
> nr_chips + 1.
> 
> Reported-by: Dan Carpenter <dan.carpenter at oracle.com> 
> Fixes: 885dcd709ba91 ( powerpc/perf: Add nest IMC PMU support)
> Signed-off-by: Anju T Sudhakar <anju at linux.vnet.ibm.com>
> Reviewed-by: Madhavan Srinivasan <maddy at linux.vnet.ibm.com>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/860b7d2286236170a36f94946d03ca98

cheers


More information about the Linuxppc-dev mailing list