From patchwork Fri Nov 4 08:03:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Liu Peibao X-Patchwork-Id: 15418 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp241056wru; Fri, 4 Nov 2022 01:07:03 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6SicPOcR7yuOqymIEkijdIEmbrTD/oBa3Ez/6K8USKmUNttB+z7pSrVShD+9oV0N7Q/iYB X-Received: by 2002:a05:6402:1219:b0:462:e788:723f with SMTP id c25-20020a056402121900b00462e788723fmr34150784edw.319.1667549222778; Fri, 04 Nov 2022 01:07:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667549222; cv=none; d=google.com; s=arc-20160816; b=izR5Pxqhj7AmM6ppDuKJqPjiZfNd3r1sTpqRTNf3U6QhCJaf47yRQhNzpAa+pJb2iF S2e306jk7ZQCkafQdNvutJA9R+lxRnvp26bBo9A7zJl/RqpMrCz0VWgXYrc8Weq6jDU/ 2/eHY9rw2VeJUDtnTw3/nC9ZV5thKXiC63Ly/h4/+si+Bi6HbWPqDHZvGvgQ92YBuuf/ eRRMyv3A0xf8p1FHQoZgQEZ3f3gI+9lVVGAonBKDDzHsr5i3q9jkl4no0x31330+zPzy eiD7VTpyv8/zSg5FIQqplfzws9bN0trqnYkDlDVeFqXmNSq2T2tCe3AIuraSJMWx6ppN JWJw== 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 :message-id:date:subject:cc:to:from; bh=BarHUgiN9936VznJr4o4I/z22QiZ/wccflrSOLhVfwI=; b=lbTLhV/bQBmVR6bHCkujYJ84wMSwx64v2isTSjIhHl07G4MO2+o9fEr+yn7Pq7CZPo H1ZDRXYtkbYncIYVgt38R8PvedJa9Cburfj5CWp89OaoBzB+z+x1smGqfpaUkHGeBBVM Ol/s8QmDuQ+pztgWem8tBrPUwTmPO/5OPNSga+Kuv5rv28GUsWUK9+bqJm1xQR4KVvgX PTA1HUq6IJQc/sPqOJnj4DfvqJ9e9vj1niAvs+5JKmv8j+XsiOZvrPjIjsjn4pKgkDqu QltrSuJyOY9r6tBShAwdjWQmXy5GrYrDdJsftjhcobS+kVDfVQXekSBQj2E4rU7f18y8 lNyw== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q6-20020a056402518600b00457f31c1a10si4898272edd.584.2022.11.04.01.06.39; Fri, 04 Nov 2022 01:07:02 -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 S229995AbiKDIEE (ORCPT + 99 others); Fri, 4 Nov 2022 04:04:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231428AbiKDID6 (ORCPT ); Fri, 4 Nov 2022 04:03:58 -0400 Received: from loongson.cn (mail.loongson.cn [114.242.206.163]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E53E426579; Fri, 4 Nov 2022 01:03:53 -0700 (PDT) Received: from loongson.cn (unknown [10.20.42.77]) by gateway (Coremail) with SMTP id _____8DxTttox2RjmncEAA--.15297S3; Fri, 04 Nov 2022 16:03:52 +0800 (CST) Received: from loongson-PC.loongson.cn (unknown [10.20.42.77]) by localhost.localdomain (Coremail) with SMTP id AQAAf8Dx_1djx2Rjel0NAA--.37956S2; Fri, 04 Nov 2022 16:03:51 +0800 (CST) From: Liu Peibao To: Huacai Chen , Jiaxun Yang , Thomas Gleixner , Marc Zyngier , Jianmin Lv Cc: Yinbo Zhu , Liu Peibao , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] irqchip: loongson-liointc: fix improper error handling in liointc_init() Date: Fri, 4 Nov 2022 16:03:47 +0800 Message-Id: <20221104080347.21527-1-liupeibao@loongson.cn> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-CM-TRANSID: AQAAf8Dx_1djx2Rjel0NAA--.37956S2 X-CM-SenderInfo: xolx1vpled0qxorr0wxvrqhubq/1tbiAQAACmNjr2MWjwAAse X-Coremail-Antispam: 1Uk129KBjvdXoWrtF4DtFW7Gw4fJFW3CF47XFb_yoWkXFg_CF Z2qwsxJFyIvr1kJw1kAr1Yvry29ry8W3Wq9FW8WF1fA3yUtw13CrZrA3sxCF4IgFW09rn3 ArZ5uryxCryIkjkaLaAFLSUrUUUUbb8apTn2vfkv8UJUUUU8wcxFpf9Il3svdxBIdaVrn0 xqx4xG64xvF2IEw4CE5I8CrVC2j2Jv73VFW2AGmfu7bjvjm3AaLaJ3UjIYCTnIWjp_UUUY 87kC6x804xWl14x267AKxVWUJVW8JwAFc2x0x2IEx4CE42xK8VAvwI8IcIk0rVWrJVCq3w AFIxvE14AKwVWUXVWUAwA2ocxC64kIII0Yj41l84x0c7CEw4AK67xGY2AK021l84ACjcxK 6xIIjxv20xvE14v26ryj6F1UM28EF7xvwVC0I7IYx2IY6xkF7I0E14v26r4j6F4UM28EF7 xvwVC2z280aVAFwI0_Gr1j6F4UJwA2z4x0Y4vEx4A2jsIEc7CjxVAFwI0_Gr1j6F4UJwAS 0I0E0xvYzxvE52x082IY62kv0487Mc804VCY07AIYIkI8VC2zVCFFI0UMc02F40EFcxC0V AKzVAqx4xG6I80ewAv7VC0I7IYx2IY67AKxVWUXVWUAwAv7VC2z280aVAFwI0_Gr0_Cr1l Ox8S6xCaFVCjc4AY6r1j6r4UM4x0Y48IcxkI7VAKI48JMxAIw28IcxkI7VAKI48JMxC20s 026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_ JrI_JrWlx4CE17CEb7AF67AKxVWUtVW8ZwCIc40Y0x0EwIxGrwCI42IY6xIIjxv20xvE14 v26r1j6r1xMIIF0xvE2Ix0cI8IcVCY1x0267AKxVWUJVW8JwCI42IY6xAIw20EY4v20xva j40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Gr0_Cr1lIxAIcVC2z280aVCY1x0267AKxVW8JV W8JrUvcSsGvfC2KfnxnUUI43ZEXa7IU8vApUUUUUU== X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748552093575068293?= X-GMAIL-MSGID: =?utf-8?q?1748552093575068293?= For cores less than 4, eg, loongson2k1000 with 2 cores, the of_property_match_string() may return with an error value, which causes that liointc could not work. At least one isr is what should be checked like previous commit (irqchip/loongson-liointc: irqchip add 2.0 version) did. Fixes: 0858ed035a85 ("irqchip/loongson-liointc: Add ACPI init support") Signed-off-by: Liu Peibao --- drivers/irqchip/irq-loongson-liointc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/irqchip/irq-loongson-liointc.c b/drivers/irqchip/irq-loongson-liointc.c index 0da8716f8f24..c4584e2f0ad3 100644 --- a/drivers/irqchip/irq-loongson-liointc.c +++ b/drivers/irqchip/irq-loongson-liointc.c @@ -207,10 +207,13 @@ static int liointc_init(phys_addr_t addr, unsigned long size, int revision, "reg-names", core_reg_names[i]); if (index < 0) - goto out_iounmap; + continue; priv->core_isr[i] = of_iomap(node, index); } + + if (!priv->core_isr[0]) + goto out_iounmap; } /* Setup IRQ domain */