From patchwork Sun Nov 17 11:21:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 13877829 Received: from smtp.smtpout.orange.fr (smtp-29.smtpout.orange.fr [80.12.242.29]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 726AD7E105 for ; Sun, 17 Nov 2024 11:22:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=80.12.242.29 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731842527; cv=none; b=eMJmWCOqNPKIEriOjeQAk27plFba5308D6sogltyuA7/DDMYjGy1wH6D6y6qLlFy+363VPKScnJR2v9KlGX+fn28OedDAjBswqa5Errre0x3rXA0+1rE6cX+hURu53YYc2Jx2QkJ2JzwOP0C5af+kdiJAOJfl/qcH8PbULOdp70= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731842527; c=relaxed/simple; bh=GL6L0RdEB3pV7TqNFOrFDekS6axn/OVeGdxC9qw5byM=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=MvCrqq6pZyUIBzSpBhAnEZj7NyBnJH5scNd9TjaLl21233S32TGt3+MaXI4pwkCRDW4APrej0x1ZqjWkt0BoEBUs40o4332PAMc4z89VelpavXp1++WiAMlRfHp1ONbaVgzELrPJwceCfUldfQ/B6DJ9S9WCeGFdtC3tJqOZ3gg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wanadoo.fr; spf=pass smtp.mailfrom=wanadoo.fr; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b=g3uU7i02; arc=none smtp.client-ip=80.12.242.29 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b="g3uU7i02" Received: from localhost.localdomain ([90.11.132.44]) by smtp.orange.fr with ESMTPA id CdLltujfVkz9DCdLltiABX; Sun, 17 Nov 2024 12:21:58 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1731842518; bh=wutmjbunPazncW+7ACgp5eT9w4BJnbyk7q/fyDFLZ9g=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=g3uU7i02kt7I5UMCR2YSd0Jh7XdjTBkf1sV5I1IvB/dWjRSWhguCsUDnUcPk9SjIQ xDbA/sY5wzXGp8+lUTDjx2fYMIK+VM/BprxDh/mzNzDLzaFTigAq1Hoc/IMPxrGRgY yqA2uh+d8/VzX1GnsqNb4qS5v8Iar4rlm+iGqNfcHgGXZGryfmrV7xDXJMq7kAN91Y JyYvVYr2+ybGGGY+e7EVDLVvyXFZCP6CqVg1QbNvsA7+wIQU+PEWXsGIqQSmnZ+BLd JF7rqbpM7vRTqz1nBMLz3TAqN9PhVDxzsu0uCkF/T2TkPAYdSfR9bSUBG7OXrejMFw x+wqWFVIao+EQ== X-ME-Helo: localhost.localdomain X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sun, 17 Nov 2024 12:21:58 +0100 X-ME-IP: 90.11.132.44 From: Christophe JAILLET To: Thomas Gleixner , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Lucas Stach , Marc Zyngier , Aisheng Dong Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org Subject: [PATCH] irqchip/imx-irqsteer: Fix irq handling if an error occurs in imx_irqsteer_irq_handler() Date: Sun, 17 Nov 2024 12:21:43 +0100 Message-ID: X-Mailer: git-send-email 2.47.0 Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 chained_irq_enter(() should be paired with a corresponding chained_irq_exit(). Here, if (hwirq < 0), a early return occurs and chained_irq_exit() is not called. Add a new label and a goto for fix it. Fixes: 28528fca4908 ("irqchip/imx-irqsteer: Add multi output interrupts support") Signed-off-by: Christophe JAILLET --- Compile tested only. Review with care, irq handling is sometimes tricky... --- drivers/irqchip/irq-imx-irqsteer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/irqchip/irq-imx-irqsteer.c b/drivers/irqchip/irq-imx-irqsteer.c index 75a0e980ff35..59abe5a8beb8 100644 --- a/drivers/irqchip/irq-imx-irqsteer.c +++ b/drivers/irqchip/irq-imx-irqsteer.c @@ -135,7 +135,7 @@ static void imx_irqsteer_irq_handler(struct irq_desc *desc) if (hwirq < 0) { pr_warn("%s: unable to get hwirq base for irq %d\n", __func__, irq); - return; + goto out; } for (i = 0; i < 2; i++, hwirq += 32) { @@ -153,6 +153,7 @@ static void imx_irqsteer_irq_handler(struct irq_desc *desc) generic_handle_domain_irq(data->domain, pos + hwirq); } +out: chained_irq_exit(irq_desc_get_chip(desc), desc); }