From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 57A476FA0 for ; Mon, 16 Jan 2023 17:09:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D3949C4339C; Mon, 16 Jan 2023 17:09:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1673888943; bh=0qYRCxNp3oqgKWE4HrTO3ZC/wlJzFWBHHsUY+kfT8xE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CzUFa4Gu+zDot7/6y4heoVGui8LgK2iBOpOyVx7v98BD/DYV48GoJjAjnp3+/9RvI YPQ1CIDNtpXSqNn3KP8kyxSJNnWeURx2Oczzh4RpGCv2XsdT0e0wvJG57qtRC7DzsY v7RapNKA/14NlPMfvtPHr7R4x6wRHUsAroZQwbRI= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Yang Yingliang , =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , Michael Ellerman , Sasha Levin Subject: [PATCH 4.14 198/338] powerpc/xive: add missing iounmap() in error path in xive_spapr_populate_irq_data() Date: Mon, 16 Jan 2023 16:51:11 +0100 Message-Id: <20230116154829.596074890@linuxfoundation.org> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230116154820.689115727@linuxfoundation.org> References: <20230116154820.689115727@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Yang Yingliang [ 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 Reviewed-by: Cédric Le Goater Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/20221017032333.1852406-1-yangyingliang@huawei.com Signed-off-by: Sasha Levin --- arch/powerpc/sysdev/xive/spapr.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/powerpc/sysdev/xive/spapr.c b/arch/powerpc/sysdev/xive/spapr.c index e9b8e06c9dce..be1619c9b726 100644 --- a/arch/powerpc/sysdev/xive/spapr.c +++ b/arch/powerpc/sysdev/xive/spapr.c @@ -323,6 +323,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; } -- 2.35.1