Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp602781pxu; Fri, 11 Dec 2020 09:42:23 -0800 (PST) X-Google-Smtp-Source: ABdhPJzFRdQAAgsSH1oe4DwYlhdvZ2V5JTFo8U4o9y0vpHUfYmaQR1TPxeRTysHW3lisHN+H06C8 X-Received: by 2002:a17:906:851:: with SMTP id f17mr12071292ejd.392.1607708543272; Fri, 11 Dec 2020 09:42:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607708543; cv=none; d=google.com; s=arc-20160816; b=thkTvOZMVQDdVGM+Zc3Gcqip878+qK936GibNXQALSFWsMaKgBTJJ1YpmD2UooTmRH iFCVqjR96HW4Ze45ioYWlNDhT3BoFdH0/DGD0MRrnW/GgQZVqQ+WbmThiQJLrHn0AjK5 NRyrwH48I66GDDDhhZm1GLwV+OucxnPbs4EUvse36B92X7T45I8aw69OBmJWLMo+wJZ3 fwp9j61K19ms/pQNyvZHgChRnrq5/D7q3bC7WcOkYgW+FB0VkGX+K+xoPc/GlcN55lS5 lsbvNEYqTkkRQQaCNKT6asEUIi1GTYgmE2fj9PiLYwOX8yI7u6sODJfv/G3ms9fU6fKK QdTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=ZDitruWG2mjm+8OCjAFPP8kViYiWrc/wdrnBEMF+9QE=; b=as0Zs3qrMNtxUekd6MrDT7EDzK+9boW+KawIegLXx0fxpxFws3OzEaCjVFB/U3Ib4s Y/euVIuZu4KrXtae0LWdXOGPE2gidnrRYoCL8xbRMdW/gBM450sjasMdx5MH++qpeIPf B/kXPktJh/S7aZ2BsdeMb7sYQcpAE+ePN9yML6ktbaVKBLbN6A8rTqoGPhCGvIdjXIDB jGLdOdXfuQsxH8ZK2ec5/ddi5Ximf5N7I77/quglBWpnn6/xIRd9Dr/ZFtGjFg1656Kx ipga57pbnL20vGtZb/Ac706gpcfHyDazY0su/5/ChLFdSNd04sIlPpqKzs0pl3ZCkf7Y by7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=cUdMikcf; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=Y3ah3rAg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o14si4828650eja.222.2020.12.11.09.42.00; Fri, 11 Dec 2020 09:42:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=cUdMikcf; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=Y3ah3rAg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2406512AbgLKPAk (ORCPT + 99 others); Fri, 11 Dec 2020 10:00:40 -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; }