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 X-Spam-Level: X-Spam-Status: No, score=-20.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 755A2C433FE for ; Fri, 11 Dec 2020 15:30:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3110122D73 for ; Fri, 11 Dec 2020 15:30:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2406516AbgLKPAl (ORCPT ); Fri, 11 Dec 2020 10:00:41 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:35734 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2406449AbgLKO7h (ORCPT ); Fri, 11 Dec 2020 09:59:37 -0500 Date: Fri, 11 Dec 2020 14:58:45 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1607698726; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZDitruWG2mjm+8OCjAFPP8kViYiWrc/wdrnBEMF+9QE=; b=cUdMikcfHGS7vLj6yogpcLyXSBmQc+DWHabH4WGEjIvBMJVpYaOYX7camBrehCSxc+iIt6 TMkafutPljzkkTQIhUBXiiH6lwhVf5Qw6cBe3EeQAyZq0RQo5JEJ0AY2U0LExUVs0X5eNP FeBKgq0YxAsYzL2Nq4YGTrHKXP1nsEJgDv41g1Uh44kf9OqIJ1qYB2ZnXweJKuRRm7nBFA Z6YHO5+ULhy6vYDHngF6gHGwOKEwMyYdjDcO1+JMitS1ZQHFtl90X7s1HP88uLaJm+PkDH cCUtH4jDJcLoudVDZSVuhZN6j9+2XLkmIGMbpRDMuane/zbHyx3tG2PXCzrzHA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1607698726; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=ZDitruWG2mjm+8OCjAFPP8kViYiWrc/wdrnBEMF+9QE=; b=Y3ah3rAgWtNOQ3OVOyKVhiNGVNLigBMmCKRDAsN9AHGBOC3LnFBATcZ7PhdmAXRfBOsocd /8uA5rMJRglOzpAA== From: "irqchip-bot for Marc Zyngier" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-kernel@vger.kernel.org Subject: [irqchip: irq/irqchip-next] irqchip/alpine-msi: Fix freeing of interrupts on allocation error path Cc: Marc Zyngier , Antoine Tenart , Tsahee Zidenberg , tglx@linutronix.de In-Reply-To: <20201129135525.396671-1-maz@kernel.org> References: <20201129135525.396671-1-maz@kernel.org> MIME-Version: 1.0 Message-ID: <160769872564.3364.7955510196873731229.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-Spam: Yes Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The following commit has been merged into the irq/irqchip-next branch of irqchip: Commit-ID: 3841245e8498a789c65dedd7ffa8fb2fee2c0684 Gitweb: https://git.kernel.org/pub/scm/linux/kernel/git/maz/arm-platforms/3841245e8498a789c65dedd7ffa8fb2fee2c0684 Author: Marc Zyngier AuthorDate: Sun, 29 Nov 2020 13:55:25 Committer: Marc Zyngier CommitterDate: Fri, 11 Dec 2020 14:45:22 irqchip/alpine-msi: Fix freeing of interrupts on allocation error path The alpine-msi driver has an interesting allocation error handling, where it frees the same interrupts repeatedly. Hilarity follows. This code is probably never executed, but let's fix it nonetheless. Fixes: e6b78f2c3e14 ("irqchip: Add the Alpine MSIX interrupt controller") Signed-off-by: Marc Zyngier Reviewed-by: Antoine Tenart Cc: Tsahee Zidenberg Cc: Antoine Tenart Link: https://lore.kernel.org/r/20201129135525.396671-1-maz@kernel.org --- drivers/irqchip/irq-alpine-msi.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/irqchip/irq-alpine-msi.c b/drivers/irqchip/irq-alpine-msi.c index 23a3b87..ede02dc 100644 --- a/drivers/irqchip/irq-alpine-msi.c +++ b/drivers/irqchip/irq-alpine-msi.c @@ -165,8 +165,7 @@ static int alpine_msix_middle_domain_alloc(struct irq_domain *domain, return 0; err_sgi: - while (--i >= 0) - irq_domain_free_irqs_parent(domain, virq, i); + irq_domain_free_irqs_parent(domain, virq, i - 1); alpine_msix_free_sgi(priv, sgi, nr_irqs); return err; }