Received: by 2002:a05:7412:6592:b0:d7:7d3a:4fe2 with SMTP id m18csp894659rdg; Fri, 11 Aug 2023 03:32:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEMe0/nF3Uz53tltPOqig5vF+rsYv2IUbCv+Tl+UR6LRHstZgS0oB8/kPfPhm6VEibl23oX X-Received: by 2002:aa7:d390:0:b0:522:15c4:b5ba with SMTP id x16-20020aa7d390000000b0052215c4b5bamr1375194edq.3.1691749956131; Fri, 11 Aug 2023 03:32:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691749956; cv=none; d=google.com; s=arc-20160816; b=EV8TN1lIawxIzk5jzDOst/Ft1kYiIB+CXm53OnqOEPu3Wp9qqp1WRj2xFaJGSICEdq k+91Lo30FRdd1rP8E/PbDqngfcISoX64M9Ua1Abd3qZ2sdhS68531hZgjN/PWCyy5Rf9 lnzBdtAEt9zjr65/X/qmcA3upfXC/AqYbYbXdPOVzF6Uk0sr+jGluYYiCIDCIgJsTOgA X3fuf5pZTHGi3Ablyl/z2oLqKlBu2VNxoLX6k5PrtDJzzEW8EMWH0xINMZbkUL2swWub yqdoRkJ87jBlNO4dp2o4AMtuIDw4LZ2ToSJ75bttZD9M7eM1O+xmQHmoRiOz6VRqCaZ5 ba/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=dbI/JmCgH0U7nCu/EjEjy95SdhZVMdGYImGRmRA/Nh0=; fh=Y3+CR8DbvrL4KzdH0gKbA6cLtkHm4Wgbs811/TdZ+7Y=; b=AjXo5/J3Dm03qqoCSna4E3Mr/+HvvWxl1bk1L2aRMrYP9k0oKZiGrWkptjHNc8HZum 9CUAGHpeyBzMyvUNqvW2qwKNKzx79mHMpvB4S1QRcV0tgboJZaXHeWfhw99lT2yxI+46 Nx/T7wVuKJi2a4RjtXAfQ5r/eI17DzblbgJCioqTv487CcPckpdGgizarkUe3/jNf1XC JNGDmptL3CUYzw52CKGe7A6uD8t0dugCs5FPicYUWjgQ9nUWlkRC711MHpwXWcCm5sKJ w5zo0jV4to3UA7VA5+WagLUhFw44VN9XEOt64Endd8FAoeoKRXd2cVAEE/Sd5LK27HIc 6zmw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a7-20020aa7cf07000000b005234b034770si3130470edy.534.2023.08.11.03.32.09; Fri, 11 Aug 2023 03:32:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235291AbjHKJ6S (ORCPT + 99 others); Fri, 11 Aug 2023 05:58:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39180 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235244AbjHKJ6O (ORCPT ); Fri, 11 Aug 2023 05:58:14 -0400 Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4310D2D52 for ; Fri, 11 Aug 2023 02:58:11 -0700 (PDT) Received: from loongson.cn (unknown [10.2.9.158]) by gateway (Coremail) with SMTP id _____8BxyeoyBtZkNoAVAA--.36189S3; Fri, 11 Aug 2023 17:58:10 +0800 (CST) Received: from kvm-1-158.loongson.cn (unknown [10.2.9.158]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Dx5swtBtZkyshUAA--.59296S3; Fri, 11 Aug 2023 17:58:09 +0800 (CST) From: Bibo Mao To: Huacai Chen , Marc Zyngier Cc: Jiaxun Yang , Jianmin Lv , linux-kernel@vger.kernel.org, =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v6 1/2] irqchip/loongson-eiointc: Fix return value checking of eiointc_index Date: Fri, 11 Aug 2023 17:58:04 +0800 Message-Id: <20230811095805.2974722-2-maobibo@loongson.cn> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20230811095805.2974722-1-maobibo@loongson.cn> References: <20230811095805.2974722-1-maobibo@loongson.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-CM-TRANSID: AQAAf8Dx5swtBtZkyshUAA--.59296S3 X-CM-SenderInfo: xpdruxter6z05rqj20fqof0/ X-Coremail-Antispam: 1Uk129KBj9xXoWruFWxJrWDKr4rGryDXFW5Arc_yoWDArg_uF n29ws3Jr1F9r1xX397Zr4UZryfta4jg3Wv9F4UuF15A34jqw1rCrZFy3sxJFs2gF4fAF95 CrWYkr1Sy34IkosvyTuYvTs0mTUanT9S1TB71UUUUUJqnTZGkaVYY2UrUUUUj1kv1TuYvT s0mT0YCTnIWjqI5I8CrVACY4xI64kE6c02F40Ex7xfYxn0WfASr-VFAUDa7-sFnT9fnUUI cSsGvfJTRUUUb3AYFVCjjxCrM7AC8VAFwI0_Jr0_Gr1l1xkIjI8I6I8E6xAIw20EY4v20x vaj40_Wr0E3s1l1IIY67AEw4v_Jrv_JF1l8cAvFVAK0II2c7xJM28CjxkF64kEwVA0rcxS w2x7M28EF7xvwVC0I7IYx2IY67AKxVWUCVW8JwA2z4x0Y4vE2Ix0cI8IcVCY1x0267AKxV W8JVWxJwA2z4x0Y4vEx4A2jsIE14v26r4UJVWxJr1l84ACjcxK6I8E87Iv6xkF7I0E14v2 6r4UJVWxJr1ln4kS14v26r1Y6r17M2AIxVAIcxkEcVAq07x20xvEncxIr21l57IF6xkI12 xvs2x26I8E6xACxx1l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6xIIjxv20xvE14v26r12 6r1DMcIj6I8E87Iv67AKxVWUJVW8JwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64 vIr41l42xK82IYc2Ij64vIr41l4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1l4IxYO2xFxVAFwI0_ Jrv_JF1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s026x8GjcxK67AKxVWUGVWUWwC2zVAF1V AY17CE14v26r126r1DMIIYrxkI7VAKI48JMIIF0xvE2Ix0cI8IcVAFwI0_JFI_Gr1lIxAI cVC0I7IYx2IY6xkF7I0E14v26r1j6r4UMIIF0xvE42xK8VAvwI8IcIk0rVWUJVWUCwCI42 IY6I8E87Iv67AKxVW8JVWxJwCI42IY6I8E87Iv6xkF7I0E14v26r4j6r4UJbIYCTnIWIev Ja73UjIFyTuYvjxUc0eHDUUUU X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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é --- 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 92d8aa28bdf5..1623cd779175 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.27.0