Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2753279pxk; Tue, 15 Sep 2020 01:04:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyzZDU7U1WkLmTvtEFU31BGWNiDrI+moyWr22UiITHsCpzl84PppBwBAITagLsOeI1LWdCv X-Received: by 2002:a50:b046:: with SMTP id i64mr22002984edd.9.1600157093402; Tue, 15 Sep 2020 01:04:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600157093; cv=none; d=google.com; s=arc-20160816; b=WQm+vmwYZdEsGaZB1rPuDK9ER2lyfGqLo4xIjQ0VJHgGisSK+Vdw1eu1NN8611bnOr Hl1k0pzDNGYUXSiLZ+fCrHg+n5gY3xqhWdtaK9UWjbANcvvZyQByEp9/I1qNcPNk3nhK 8cXzYOpnRpSsOEOAQZKpaBUk/LZktCbDlzGCHh6CnsDwgy8D69AThPnT/ufS2tufRzCI zWBceJqI2S+tk3dOPBEUpiUo0W/WxVWKhv1M8h6Mq4L6HlTCPhldwzSVh3d4izbCvtXU 8xacmAL2QFe7TQw7sXZMREwtUsVt9Shl/K3Y1dJuFzK8y3kvi/GrGe6JAlFy3dOukU7P uByA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=kTSGxknFcGr6t6p0rAKRrbNnhmmQzt0PzHpDkptEtic=; b=Lbg1SnxQTbuEQwyaQHJ1LcdpjvmwxIPmyCqfRRbAm/4EPxC1QY0FLqUQfKPp7P1Pxq j8Yq5th2DJM285ZlkJnvkm4IqTzgPgatWuFSGd6/dyRfFm3hLKV7g0l4pL9xdMS5uIG2 vnnEb352V/rdQ8KNNszJrRhJ7fYCfvCtvtpEd7sniMhEjtRgPKRPrK32gmytCpGhRKTs XaIelJIJuazdtzWaRmFcpCpdFJNbw5qcR7njPsbnCk0YFdpgtfaNd7U36h84DwM0po8c CbHsJeBzruy4xg7bth9gWxy2odR4kU2wHVyJyJ8sg8E0Ha0zw63UrKY3+didsr5/SXPO FCgw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j15si8071177ejf.18.2020.09.15.01.04.31; Tue, 15 Sep 2020 01:04:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726202AbgIOH7B (ORCPT + 99 others); Tue, 15 Sep 2020 03:59:01 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:12285 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726184AbgIOH5N (ORCPT ); Tue, 15 Sep 2020 03:57:13 -0400 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id E86FA538C5EECBD3BFB2; Tue, 15 Sep 2020 15:56:58 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.487.0; Tue, 15 Sep 2020 15:56:47 +0800 From: Wei Yongjun To: Santosh Shilimkar , Grzegorz Jaszczyk CC: Wei Yongjun , , , , Hulk Robot Subject: [PATCH -next] soc: ti: pruss: Fix return value check Date: Tue, 15 Sep 2020 07:57:32 +0000 Message-ID: <20200915075732.100804-1-weiyongjun1@huawei.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT X-Originating-IP: [10.175.113.25] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In case of error, the function of_device_get_match_data() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Fixes: ba59c9b43c86 ("soc: ti: pruss: support CORECLK_MUX and IEPCLK_MUX") Reported-by: Hulk Robot Signed-off-by: Wei Yongjun --- drivers/soc/ti/pruss.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/soc/ti/pruss.c b/drivers/soc/ti/pruss.c index cc0b4ad7a3d3..582f48051c30 100644 --- a/drivers/soc/ti/pruss.c +++ b/drivers/soc/ti/pruss.c @@ -126,7 +126,7 @@ static int pruss_clk_init(struct pruss *pruss, struct device_node *cfg_node) int ret = 0; data = of_device_get_match_data(dev); - if (IS_ERR(data)) + if (!data) return -ENODEV; clks_np = of_get_child_by_name(cfg_node, "clocks"); @@ -175,7 +175,7 @@ static int pruss_probe(struct platform_device *pdev) const char *mem_names[PRUSS_MEM_MAX] = { "dram0", "dram1", "shrdram2" }; data = of_device_get_match_data(&pdev->dev); - if (IS_ERR(data)) { + if (!data) { dev_err(dev, "missing private data\n"); return -ENODEV; }