From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 003591170E for ; Mon, 11 Sep 2023 13:54:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 73236C433C8; Mon, 11 Sep 2023 13:54:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1694440483; bh=ipdhutseK9XcB3OIZPe6zWBW/ag7fNvSnEwjk5hN58A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0EbHObQy+IrTD8DSG21yX9/f6zORr3/IXNIIeGsn9PHwfnC/L2FJMxroC1Ugf0oav Mkrsyvd7RfyOS+GvGDRbboGil4WAw4GEh0/DirvJ1iUECZApuLnn+QXSwyzz/NYgXG /NOUXF4E+yqAdFX0v/BuFDE4I+vOyg98PDpppSpw= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Bibo Mao , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Marc Zyngier , Sasha Levin Subject: [PATCH 6.5 051/739] irqchip/loongson-eiointc: Fix return value checking of eiointc_index Date: Mon, 11 Sep 2023 15:37:30 +0200 Message-ID: <20230911134652.545785011@linuxfoundation.org> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20230911134650.921299741@linuxfoundation.org> References: <20230911134650.921299741@linuxfoundation.org> User-Agent: quilt/0.67 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 6.5-stable review patch. If anyone has any objections, please let me know. ------------------ From: Bibo Mao [ Upstream commit 2e99b73afde18853754c5fae8e8d1a66fe5e3f64 ] Return value of function eiointc_index is int, however it is converted into uint32_t and then compared smaller than zero, this will cause logic problem. Fixes: dd281e1a1a93 ("irqchip: Add Loongson Extended I/O interrupt controller support") Signed-off-by: Bibo Mao Reviewed-by: Philippe Mathieu-Daudé Signed-off-by: Marc Zyngier Link: https://lore.kernel.org/r/20230811095805.2974722-2-maobibo@loongson.cn Signed-off-by: Sasha Levin --- drivers/irqchip/irq-loongson-eiointc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/irqchip/irq-loongson-eiointc.c b/drivers/irqchip/irq-loongson-eiointc.c index 92d8aa28bdf54..1623cd7791752 100644 --- a/drivers/irqchip/irq-loongson-eiointc.c +++ b/drivers/irqchip/irq-loongson-eiointc.c @@ -144,7 +144,7 @@ static int eiointc_router_init(unsigned int cpu) int i, bit; uint32_t data; uint32_t node = cpu_to_eio_node(cpu); - uint32_t index = eiointc_index(node); + int index = eiointc_index(node); if (index < 0) { pr_err("Error: invalid nodemap!\n"); -- 2.40.1