Received: by 2002:a5d:925a:0:0:0:0:0 with SMTP id e26csp335580iol; Sat, 11 Jun 2022 05:32:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzKwVGS18xLTljRQvFmAJvg5S79lbx6qhPj3OiiBkWxHqQmd9OEs4ucjm8ldKqe+NaUuOGQ X-Received: by 2002:aa7:ca59:0:b0:42d:c34e:5832 with SMTP id j25-20020aa7ca59000000b0042dc34e5832mr55094338edt.75.1654950764937; Sat, 11 Jun 2022 05:32:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654950764; cv=none; d=google.com; s=arc-20160816; b=fzZYEjH8tAmaUwhZDQUJe7iUqxwX+BfoDhgocBmybFLScDZ0Q6l+wVbpSTxlo7Epsi hXZp3aKOyhHFyxmoKTNOIWbh7zefvIMs13PVPgRKcJQ4/3xHnPl6/I7M1QprqRkVKsCP V5TbJ7ZWsSqetir9puWM8iXr6Qq9Fx7yeEebghmjFOgVaMzEbQWfp6x1apNHoETvhnhc oq6KGOfSLEu12/wHpk8r7cHRshAAz+gTPvm60GkgdGcNTqBecivC8MhdgPPq5/Hcnq/t ghMiVI+JxgzWOFBVLS3Rj/TJyWG3irftVINJi6yRyy5hg9Obognb/k82AJaGA7DSZXgC lBIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=cyKqH+YdBh5vND+sWmxgmzRNoMI5hp4XhGA+cL3VTKI=; b=wUcQGH9ehD2YNdPIdvov2yuSSluAJk+cKeprS3w5iM4motB9VMWDOOQzHcFxCsOgQJ PnVHDzz6/7nw+cOAJwXmaK02NOiV01n5mMYQ7KyjlsJXFF/6mO5JTcunWekQXWCBWl5o Sh22qD6lin29hS99R9vP8Zw5f9q+pM2xd2Gl9uZ+ukgjiXgx3dV3KJRNAHaC7Vsman3J T+ZVNtAQADTyW+7RTc3cghWHjN4kK/QslwiLnYljg3ApNbcLUQEt0pJGWRR5GNH6ght0 t61bZrA2L+cs5eZQSad11Hp9mkVWJVgKVsNzX/QxN27YKsqUuwlGJ7qpVqnM0NPpNi4f FZIQ== 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 di8-20020a170906730800b006fe9a0289d5si2183316ejc.885.2022.06.11.05.32.19; Sat, 11 Jun 2022 05:32:44 -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 S231278AbiFKLuq (ORCPT + 99 others); Sat, 11 Jun 2022 07:50:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50042 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230289AbiFKLup (ORCPT ); Sat, 11 Jun 2022 07:50:45 -0400 Received: from mail.nfschina.com (unknown [IPv6:2400:dd01:100f:2:72e2:84ff:fe10:5f45]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D40F03FDA8 for ; Sat, 11 Jun 2022 04:50:43 -0700 (PDT) Received: from localhost (unknown [127.0.0.1]) by mail.nfschina.com (Postfix) with ESMTP id EAF341E80D77; Sat, 11 Jun 2022 19:49:48 +0800 (CST) X-Virus-Scanned: amavisd-new at test.com Received: from mail.nfschina.com ([127.0.0.1]) by localhost (mail.nfschina.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ZAWslLkv7asd; Sat, 11 Jun 2022 19:49:46 +0800 (CST) Received: from localhost.localdomain (unknown [180.167.10.98]) (Authenticated sender: liqiong@nfschina.com) by mail.nfschina.com (Postfix) with ESMTPA id D0A4B1E80D70; Sat, 11 Jun 2022 19:49:45 +0800 (CST) From: Li Qiong To: Qiang Zhao , Li Yang Cc: linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, yuzhe@nfschina.com, renyu@nfschina.com, Li Qiong Subject: [PATCH] soc: fsl: qe: Check of ioremap return value in qe_reset Date: Sat, 11 Jun 2022 19:49:45 +0800 Message-Id: <20220611114945.24045-1-liqiong@nfschina.com> X-Mailer: git-send-email 2.11.0 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,RDNS_NONE, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 As the possible failure of the ioremap(), the qe_immr could be NULL. Therefore it should be better to check it and print error message. Signed-off-by: Li Qiong --- drivers/soc/fsl/qe/qe.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/soc/fsl/qe/qe.c b/drivers/soc/fsl/qe/qe.c index b3c226eb5292..3c0948c2440e 100644 --- a/drivers/soc/fsl/qe/qe.c +++ b/drivers/soc/fsl/qe/qe.c @@ -88,6 +88,11 @@ void qe_reset(void) if (qe_immr == NULL) qe_immr = ioremap(get_qe_base(), QE_IMMAP_SIZE); + if (!qe_immr) { + pr_err("%s: failed to ioremap()\n", __func__); + return; + } + qe_snums_init(); qe_issue_cmd(QE_RESET, QE_CR_SUBBLOCK_INVALID, -- 2.11.0