Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp426096rwd; Thu, 1 Jun 2023 02:06:24 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6JL+kY5telIoAqsCqUbWw/bpS66rt4yqZEAZGo5e/CtUGHeFcT1NFAyMj7asv5/cX9Q/oH X-Received: by 2002:a05:6808:2799:b0:398:7db6:7ee3 with SMTP id es25-20020a056808279900b003987db67ee3mr6455706oib.19.1685610384260; Thu, 01 Jun 2023 02:06:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685610384; cv=none; d=google.com; s=arc-20160816; b=Gt7TPoT+A0T83axq3N4uufTsBY5M3NaiDMqgC5tg13+WtqNAks/i6MaeFpCcI6Aee8 aZ947+kljT59sjr+Ak+sGrGFYEF9SGXDPSaXMGKErONtHj8aqNYqcy2OOunMiwuWFxKN Krv2Jxa0P/ozeHpwVXKKLxUhUUaiud+TfiFdFBbAq5pLUKEsYti1dGEQNZTsE1sv2lO/ bQPn4y8PE4ZsNy7+JCdB+wmtC9bZC3wJ7LOJ3SEg1+C6fEXZcIjXjUaHzHaffhPY8Mco Rfz2vRRYCUPCwsuVoo5SZU0oYi/O/M5Opj4Ea6MnjDkeLtv9YgulD/UmS7XnXfi0xFTy 7hwA== 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=B66J+r+WKWhIHGEaTQ6n56AP2CMCRWbsfM+ldxXgm98=; b=LE9o5IxQ1W1+NouZ31Z04SlsUWdXm6QgcJCN9UUsHgD++9jyQ+6JY2lyytSoC6t28d 9JFPslj/PyQFtGrAwYJjRzE12iOssvNzb2s1poOMZVN58+aJvy3do/FH2dTUFR+5VUoR LwhKQTfwsfeho1Ip93l3SiNBY501ZL6ZrAkZsWFYnrvuiTAH0WhJLNyv2xQczzhULXcp 6gDQduPSsiPNNN06Zvq1nHIJGPBxvVJd+AS8/htc/l5pyhiJWzcQfn1vX3V3noyNYpD3 P6EHxLriFfTNI6jnVDxON+78EfzbYZFYxP7SXksITeGk88YFi17zqIMIfUgecsU0E/QF MKFw== 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 c20-20020a6566d4000000b0052cc25bd286si2486189pgw.756.2023.06.01.02.06.10; Thu, 01 Jun 2023 02:06:24 -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 S232297AbjFAIvo (ORCPT + 99 others); Thu, 1 Jun 2023 04:51:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51644 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230468AbjFAIvn (ORCPT ); Thu, 1 Jun 2023 04:51:43 -0400 Received: from cstnet.cn (smtp25.cstnet.cn [159.226.251.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BBA479F; Thu, 1 Jun 2023 01:51:41 -0700 (PDT) Received: from localhost.localdomain (unknown [124.16.138.125]) by APP-05 (Coremail) with SMTP id zQCowADn7IwWXHhkXdQzCQ--.52693S2; Thu, 01 Jun 2023 16:51:35 +0800 (CST) From: Jiasheng Jiang To: albeu@free.fr, linus.walleij@linaro.org, brgl@bgdev.pl Cc: linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org, Jiasheng Jiang Subject: [PATCH] gpio: ath79: Add missing check for platform_get_irq Date: Thu, 1 Jun 2023 16:51:32 +0800 Message-Id: <20230601085132.12508-1-jiasheng@iscas.ac.cn> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: zQCowADn7IwWXHhkXdQzCQ--.52693S2 X-Coremail-Antispam: 1UD129KBjvdXoW7Xr4xtryDtF4rZw1kKFyUKFg_yoW3Crg_Cw n7Xw17Wr48CrnYqr12yw12yrWSyr93urn3Zr4vga1aqr98Arsrur9ruw1rZr17XrWUKFyU Gas2krWjyFs3GjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUbcxFF20E14v26r1j6r4UM7CY07I20VC2zVCF04k26cxKx2IYs7xG 6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8w A2z4x0Y4vE2Ix0cI8IcVAFwI0_JFI_Gr1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Gr0_ Cr1l84ACjcxK6I8E87Iv67AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aVCY1x0267AKxVWxJr 0_GcWle2I262IYc4CY6c8Ij28IcVAaY2xG8wAqx4xG64xvF2IEw4CE5I8CrVC2j2WlYx0E 2Ix0cI8IcVAFwI0_Jr0_Jr4lYx0Ex4A2jsIE14v26r4j6F4UMcvjeVCFs4IE7xkEbVWUJV W8JwACjcxG0xvY0x0EwIxGrwACjI8F5VA0II8E6IAqYI8I648v4I1lc2xSY4AK67AK6r43 MxAIw28IcxkI7VAKI48JMxC20s026xCaFVCjc4AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr 0_Jr4lx2IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUAVWUtwCIc40Y0x0E wIxGrwCI42IY6xIIjxv20xvE14v26r1j6r1xMIIF0xvE2Ix0cI8IcVCY1x0267AKxVWUJV W8JwCI42IY6xAIw20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Jr0_Gr1lIxAI cVC2z280aVCY1x0267AKxVW8JVW8JrUvcSsGvfC2KfnxnUUI43ZEXa7VUUBWl3UUUUU== X-Originating-IP: [124.16.138.125] X-CM-SenderInfo: pmld2xxhqjqxpvfd2hldfou0/ X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 Add the missing check for platform_get_irq and return error if it fails. Fixes: 2b8f89e19b6d ("gpio: ath79: Add support for the interrupt controller") Signed-off-by: Jiasheng Jiang --- drivers/gpio/gpio-ath79.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpio/gpio-ath79.c b/drivers/gpio/gpio-ath79.c index aa0a954b8392..4b67428a8c17 100644 --- a/drivers/gpio/gpio-ath79.c +++ b/drivers/gpio/gpio-ath79.c @@ -286,6 +286,8 @@ static int ath79_gpio_probe(struct platform_device *pdev) if (!girq->parents) return -ENOMEM; girq->parents[0] = platform_get_irq(pdev, 0); + if (girq->parents[0] < 0) + return -ENODEV; girq->default_type = IRQ_TYPE_NONE; girq->handler = handle_simple_irq; } -- 2.25.1