powerpc/xive: Add some error handling code to 'xive_spapr_init()'
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Tue, 1 Feb 2022 12:31:16 +0000 (13:31 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 9 Jun 2022 08:23:12 +0000 (10:23 +0200)
commitfd7a3548af09660908a63e824eedf78cc4a089e3
tree6196fb37dbc04e0a76cb3b5f59b00e685308e0cd
parentf04604987c7b054c8bc63b1814dc56d161ba587a
powerpc/xive: Add some error handling code to 'xive_spapr_init()'

[ Upstream commit e414e2938ee26e734f19e92a60cd090ebaff37e6 ]

'xive_irq_bitmap_add()' can return -ENOMEM.
In this case, we should free the memory already allocated and return
'false' to the caller.

Also add an error path which undoes the 'tima = ioremap(...)'

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Cédric Le Goater <clg@kaod.org>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/564998101804886b151235c8a9f93020923bfd2c.1643718324.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/powerpc/sysdev/xive/spapr.c