Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1524961pxb; Wed, 30 Mar 2022 05:38:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwrsWL5zUCMWLqgMErDs21e39AISwiYGTkpeUf/01IUogj6+0tzxq3K0cNiqxyGHR1+eLF4 X-Received: by 2002:a17:907:9617:b0:6df:d17b:f869 with SMTP id gb23-20020a170907961700b006dfd17bf869mr40196176ejc.569.1648643892219; Wed, 30 Mar 2022 05:38:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648643892; cv=none; d=google.com; s=arc-20160816; b=v7iTo9I9LX4Eudf6egcR8TIIsXdDOCboM6BBtS2zVdgwLXzLw/+sMwp7RY/VYQUxe2 hAY/1BpX9CmVEwdoZyAM62mH2cRgrH1/n9PUmUMPb3DmP/ktuNpWtqmUw/EVdK4+tPvf NLKjQYHDjah+mWGy11PU7+hrkCb2QasTh5PUAKxt6dkLtls+GfB9eQ2AX7QqXzVBra0E CSh8pNzWEe+pTm4mwH1tOS0DQhpSWd4m5dDXIAR53FLxk21Xk8yful86wvDXFxaQ5gYS 2GfiPQREJ6CS9r/7elOUcwyjRMcb+bsaVneZJJpkPV8kbP96OFUg1GvfzE4M7kPfVk/d zffQ== 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=Ig4mHbXPQppagswbiQIneau7QaQNH24ZM4KcVpoHjwA=; b=i8ALHOmQ7OV1oPI5F/0o6qPMH/TeyN4jAV3/xWwxuj3YpZGfrsgTA5q4BlTe0kkqwI hEGCykm6/lf/dv2/wVK39KhDu6/v8fed5XLpIT8jvzqdeivLCyXQlSK2KZbpimAbEsHk 3pk7vlh+zSQLBqQ7oja6QBW8CuUVgRmmZDqdOsZS6F2fJ6xg8XhHLp31Jeaf23Bmle1Z fiVybYRRZLrmLREuzIklAUk9MGb1/NglxrwjMS0nIYF2/M/5XRcyhjVwYtlN3lnN+rZH zyGUBQRzsyLu7AxRAxJBrPQAW6EY3HddSl8F+FSBCEnQkGA4ng4DRFJrini/73uDu+DB DpIg== 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 h15-20020a50ed8f000000b00418c2b5bee0si21609885edr.450.2022.03.30.05.37.45; Wed, 30 Mar 2022 05:38:12 -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 S242190AbiC3KUL (ORCPT + 99 others); Wed, 30 Mar 2022 06:20:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59530 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229870AbiC3KUK (ORCPT ); Wed, 30 Mar 2022 06:20:10 -0400 Received: from mail.meizu.com (edge05.meizu.com [157.122.146.251]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1137313E09 for ; Wed, 30 Mar 2022 03:18:23 -0700 (PDT) Received: from IT-EXMB-1-125.meizu.com (172.16.1.125) by mz-mail12.meizu.com (172.16.1.108) with Microsoft SMTP Server (TLS) id 14.3.487.0; Wed, 30 Mar 2022 18:18:24 +0800 Received: from meizu.meizu.com (172.16.137.70) by IT-EXMB-1-125.meizu.com (172.16.1.125) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.14; Wed, 30 Mar 2022 18:18:21 +0800 From: Haowen Bai To: Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Ivan Bornyakov CC: Haowen Bai , , Subject: [PATCH] bus: imx-weim: fix pdev is NULL but dereferenced Date: Wed, 30 Mar 2022 18:18:20 +0800 Message-ID: <1648635500-12631-1-git-send-email-baihaowen@meizu.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [172.16.137.70] X-ClientProxiedBy: IT-EXMB-1-124.meizu.com (172.16.1.124) To IT-EXMB-1-125.meizu.com (172.16.1.125) X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00,KHOP_HELO_FCRDNS, SPF_HELO_NONE,SPF_SOFTFAIL,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 pdev is NULL,so we can't dereference it dev_err(&pdev->dev Fixes: e6cb540 ("bus: imx-weim: add DT overlay support for WEIM bus") Signed-off-by: Haowen Bai --- drivers/bus/imx-weim.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/bus/imx-weim.c b/drivers/bus/imx-weim.c index 60fbd42..31a2213 100644 --- a/drivers/bus/imx-weim.c +++ b/drivers/bus/imx-weim.c @@ -352,9 +352,8 @@ static int of_weim_notify(struct notifier_block *nb, unsigned long action, pdev = of_find_device_by_node(rd->dn); if (!pdev) { - dev_err(&pdev->dev, - "Could not find platform device for '%pOF'\n", - rd->dn); + pr_err("%s: Could not find platform device for '%pOF'\n", + __func__, rd->dn); ret = notifier_from_errno(-EINVAL); } else { -- 2.7.4