powerpc/powernv: Add a null pointer check in opal_event_init()
authorKunwu Chan <chentao@kylinos.cn>
Mon, 27 Nov 2023 03:07:55 +0000 (11:07 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Jan 2024 23:35:13 +0000 (15:35 -0800)
commita14c55eb461d630b836f80591d8caf1f74e62877
tree0a1666a4ede204bd7a06e921e40a1308203ddafe
parentdd8422ff271c22058560832fc3006324ded895a9
powerpc/powernv: Add a null pointer check in opal_event_init()

[ Upstream commit 8649829a1dd25199bbf557b2621cedb4bf9b3050 ]

kasprintf() returns a pointer to dynamically allocated memory
which can be NULL upon failure.

Fixes: 2717a33d6074 ("powerpc/opal-irqchip: Use interrupt names if present")
Signed-off-by: Kunwu Chan <chentao@kylinos.cn>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/20231127030755.1546750-1-chentao@kylinos.cn
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/powerpc/platforms/powernv/opal-irqchip.c