From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B10CACD11DD for ; Wed, 27 Mar 2024 14:23:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:CC :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=j7+ukTvku4liolMykHMrSplhSejWtg4zNL3GhWtrOvA=; b=cX4ExxyBPXhrcK BBkAfnpPkrA2wz5qD36Bf0XV2/+REXi1AxsT/8Aez9YpDSiQDUmy6dRZBBXUp42yJFUqTWT1bnpi0 bJTR2U8ckzd80HWmyKRCzCx2sfCwNqkU4IMKb3+ILyC2Jk6A1Eb3P7ZGMRap+mW7cz6WKKhaJaD6U pWrAKrrPov2EHIATOz3jYinbkJZgAESgHdAqz6a6/U4PpFIPJepav/LrtzFzKl8UZeSBo/WVC7U8a 5tNmIpbnZkRJrNuI9faKjkooTHaL5ggAy6Cy8ON39wfMLVhKVma/d9BWsjFy2alHrOP28lnX2e4wm KqBn4DGV97SWdWeY5jJg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rpUBY-00000009Rbz-0pyj; Wed, 27 Mar 2024 14:23:24 +0000 Received: from szxga02-in.huawei.com ([45.249.212.188]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rpUBS-00000009RYX-0hcp for linux-arm-kernel@lists.infradead.org; Wed, 27 Mar 2024 14:23:22 +0000 Received: from mail.maildlp.com (unknown [172.19.163.174]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4V4TN94sBJzXjx6; Wed, 27 Mar 2024 22:20:25 +0800 (CST) Received: from kwepemm600007.china.huawei.com (unknown [7.193.23.208]) by mail.maildlp.com (Postfix) with ESMTPS id 047BF140258; Wed, 27 Mar 2024 22:23:13 +0800 (CST) Received: from DESKTOP-8RFUVS3.china.huawei.com (10.174.185.179) by kwepemm600007.china.huawei.com (7.193.23.208) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.35; Wed, 27 Mar 2024 22:23:12 +0800 From: Zenghui Yu To: , CC: , , , Zenghui Yu , Tsahee Zidenberg , Antoine Tenart Subject: [PATCH] irqchip/alpine-msi: Fix off-by-one on allocation error path Date: Wed, 27 Mar 2024 22:23:05 +0800 Message-ID: <20240327142305.1048-1-yuzenghui@huawei.com> X-Mailer: git-send-email 2.23.0.windows.1 MIME-Version: 1.0 X-Originating-IP: [10.174.185.179] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To kwepemm600007.china.huawei.com (7.193.23.208) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240327_072318_446323_8F30C929 X-CRM114-Status: GOOD ( 10.65 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org When alpine_msix_gic_domain_alloc() returns an error, there is an off-by-one in the number of IRQs to be freed. Fix it by passing the number of successfully allocated IRQs, instead of the relative index of the last allocated one. Fixes: 3841245e8498 ("irqchip/alpine-msi: Fix freeing of interrupts on allocation error path") Cc: Tsahee Zidenberg Cc: Antoine Tenart Signed-off-by: Zenghui Yu --- drivers/irqchip/irq-alpine-msi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/irqchip/irq-alpine-msi.c b/drivers/irqchip/irq-alpine-msi.c index 9c8b1349ee17..a1430ab60a8a 100644 --- a/drivers/irqchip/irq-alpine-msi.c +++ b/drivers/irqchip/irq-alpine-msi.c @@ -165,7 +165,7 @@ static int alpine_msix_middle_domain_alloc(struct irq_domain *domain, return 0; err_sgi: - irq_domain_free_irqs_parent(domain, virq, i - 1); + irq_domain_free_irqs_parent(domain, virq, i); alpine_msix_free_sgi(priv, sgi, nr_irqs); return err; } -- 2.33.0 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel