powerpc/perf: fix imc allocation failure handling
authorNicholas Piggin <npiggin@gmail.com>
Wed, 24 Jul 2019 08:46:36 +0000 (18:46 +1000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 7 Oct 2019 16:59:11 +0000 (18:59 +0200)
commita16c6638d7609e9d58ad7219eb0bf5028b4d38e2
tree70691ba3bdcd34859f0ddc43c7e40b71376b0c95
parent4ce5f278af62cd9ebe019439730bc182f2083de9
powerpc/perf: fix imc allocation failure handling

[ Upstream commit 10c4bd7cd28e77aeb8cfa65b23cb3c632ede2a49 ]

The alloc_pages_node return value should be tested for failure
before being passed to page_address.

Tested-by: Anju T Sudhakar <anju@linux.vnet.ibm.com>
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Reviewed-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20190724084638.24982-3-npiggin@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/powerpc/perf/imc-pmu.c