Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3362561pxu; Mon, 30 Nov 2020 01:01:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJwQY3LuIMJbdWw19nEkcSwfD3WDlrkg9nRpXZVOKuEaqt9tt7KyszufauSLPIu3cLUNaN4m X-Received: by 2002:a17:906:33d4:: with SMTP id w20mr8523971eja.396.1606726906148; Mon, 30 Nov 2020 01:01:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606726906; cv=none; d=google.com; s=arc-20160816; b=x4aMCc4Hjlz32NWtGxWsSjld7cGYL9mt4mnmRaVN9v47CUEOTDLQffcPAj2fTP1//B xxCnUCVGJSpJqoE4wKLxzoxVHUM+eSjaC91b+2My1bquVj/P07izdCyUpQiSyhRHM05o w6fCWzgzst+8pjwU2de70jc3ovlVDrblLqYQmwGLdg5mhJAgg3biay+TLoqh7gmjMD39 DYO14TbF+Qr+pRMSVpIAsrtvLqMAQS7tZWjoADyce3TUunv7bND6qKyJFdBCTh0mRvU6 eyTf8+iRgB0bO978RY+ZeYy7IE15Aq1nz1wDEUGB/QtSGsHuAFWj35AIdw2OHSEteteH lu/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:date:message-id:cc:to:subject:from:references :in-reply-to:content-transfer-encoding:mime-version:dkim-signature; bh=2rB4WI9G7Ft4FdM3u6FLL4cPP/bavxF8UAblQvQXPH0=; b=IitJVBQsoBrFIt8cYSjBE1TYvrYqDfKD4V1fcGqRgr07PHR1oxhQfTYNjJKlgOdpor YKxp6bONeqpZX5unLh/vLALWtq4vfIvtbmhCdcFOxHoegRjEZ841BWe3VYBXfmGefK4U rsYcjloYQNRQG72yynMi5j9wxWOmkQa/riQYzrPW1IFN+ATTsNZXvu8BaxkVEga8pKXF 0zOwZ9eVj4+airlc4wySt/+L1bUdHvRkePY+KO+hXcxi3LFnL/jIWI2ItOIrCQnOUEYr 0L/epejyuD/IsoEUOyAYoRvX6fpzHwGR2Jr32Oae+Q+nYWxId26PzxYS2Y6SO0CNI8oz sRVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="lNx2ZA5/"; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n11si10186955eji.631.2020.11.30.01.01.23; Mon, 30 Nov 2020 01:01:46 -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=@kernel.org header.s=default header.b="lNx2ZA5/"; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727720AbgK3I71 (ORCPT + 99 others); Mon, 30 Nov 2020 03:59:27 -0500 Received: from mail.kernel.org ([198.145.29.99]:40244 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727662AbgK3I70 (ORCPT ); Mon, 30 Nov 2020 03:59:26 -0500 Received: from localhost (lfbn-tou-1-1075-236.w90-76.abo.wanadoo.fr [90.76.143.236]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8E9302074A; Mon, 30 Nov 2020 08:58:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1606726726; bh=PiMzl5bnuYdPj6Syuw2erWkfTDrkKeAjIdjuNj4J0bc=; h=In-Reply-To:References:From:Subject:To:Cc:Date:From; b=lNx2ZA5/+lvaHjLAmh8seGbJO7F4ZWNQ3YkvHNvhnxZQfXiKGFxCUF2l3tm3kY4/L q2AyTo0Cr8TTvlPaX3IGcV8sr66KU/KimKbsAT/o8j2bJgorvLIxl11iLvyWtVQ89Y nCH7X+k2cwQcjPu0DeTiQQJJ/2LdHy3a6tw0p2EI= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <20201129135525.396671-1-maz@kernel.org> References: <20201129135525.396671-1-maz@kernel.org> From: Antoine Tenart Subject: Re: [PATCH] irqchip/alpine-msi: Fix freeing of interrupts on allocation error path To: Marc Zyngier , linux-kernel@vger.kernel.org Cc: Thomas Gleixner , Tsahee Zidenberg Message-ID: <160672672303.3588.8640979209865178403@kwain.local> Date: Mon, 30 Nov 2020 09:58:43 +0100 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello Marc, Quoting Marc Zyngier (2020-11-29 14:55:25) > The alpine-msi driver has an interesting allocation error handling, > where it frees the same interrupts repeatedly. Hilarity follows. That's interesting indeed... > This code is probably never executed, but let's fix it nonetheless. >=20 > Fixes: e6b78f2c3e14 ("irqchip: Add the Alpine MSIX interrupt controller") > Cc: Tsahee Zidenberg > Cc: Antoine Tenart > Signed-off-by: Marc Zyngier Reviewed-by: Antoine Tenart Thanks, Antoine > --- > drivers/irqchip/irq-alpine-msi.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) >=20 > diff --git a/drivers/irqchip/irq-alpine-msi.c b/drivers/irqchip/irq-alpin= e-msi.c > index 23a3b877f7f1..ede02dc2bcd0 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; > =20 > err_sgi: > - while (--i >=3D 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; > } > --=20 > 2.29.2 >=20