summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorYang Yingliang <yangyingliang@huawei.com>2022-10-17 06:23:33 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-01-18 13:41:30 +0300
commitcfb5bbfcb63b25e9b6bbeb3206ffffd96f12d508 (patch)
tree725c135d42fa5bb2e1f85c2cdab3e481b634139a /arch
parentf2d60f6ba173cded65081cee690b67802395a479 (diff)
downloadlinux-cfb5bbfcb63b25e9b6bbeb3206ffffd96f12d508.tar.xz
powerpc/xive: add missing iounmap() in error path in xive_spapr_populate_irq_data()
[ Upstream commit 8b49670f3bb3f10cd4d5a6dca17f5a31b173ecdc ] If remapping 'data->trig_page' fails, the 'data->eoi_mmio' need be unmapped before returning from xive_spapr_populate_irq_data(). Fixes: eac1e731b59e ("powerpc/xive: guest exploitation of the XIVE interrupt controller") Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> Reviewed-by: Cédric Le Goater <clg@kaod.org> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20221017032333.1852406-1-yangyingliang@huawei.com Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/sysdev/xive/spapr.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/powerpc/sysdev/xive/spapr.c b/arch/powerpc/sysdev/xive/spapr.c
index b21d71badaec..e6788bc06584 100644
--- a/arch/powerpc/sysdev/xive/spapr.c
+++ b/arch/powerpc/sysdev/xive/spapr.c
@@ -422,6 +422,7 @@ static int xive_spapr_populate_irq_data(u32 hw_irq, struct xive_irq_data *data)
data->trig_mmio = ioremap(data->trig_page, 1u << data->esb_shift);
if (!data->trig_mmio) {
+ iounmap(data->eoi_mmio);
pr_err("Failed to map trigger page for irq 0x%x\n", hw_irq);
return -ENOMEM;
}