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:26:10 +0000 (10:26 +0200)
commitc5dc3ab2a24e5b62d68a108054ced962c39faae5
tree6d8432b44736719781d89d3ca126b7ea3236c347
parent18790388171fbcafaee1cb553f23c2da33cb9e5d
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