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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3CF70CA0EC6 for ; Mon, 11 Sep 2023 22:10:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1358282AbjIKWI2 (ORCPT ); Mon, 11 Sep 2023 18:08:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238369AbjIKNys (ORCPT ); Mon, 11 Sep 2023 09:54:48 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A735FA for ; Mon, 11 Sep 2023 06:54:44 -0700 (PDT) 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 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org 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