From patchwork Tue Sep 15 07:57:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wei Yongjun X-Patchwork-Id: 11775813 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 99EC292C for ; Tue, 15 Sep 2020 07:59:21 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6567021974 for ; Tue, 15 Sep 2020 07:59:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="COs0piDF" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6567021974 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=Z+QX8Z/i/+THiMBoJkcEeD5xxIIkIN56+Zu0DD2hOLs=; b=COs0piDFBlCR6gDGMKr5WryGEQ 03xtG+PPhPX9sBQYeOUmJ6zzBH83BFGqNSjJ3cvbMXS6IRN2D51t/H2zVDgVazcLNiI7IYMf4xwmu XolkzvjVca0ufbeceugfZbRgPTRbEvrmiJvr9PylThJ2KGYAw2oAlcB+0RM1wOYzKshnek1v85isP b/Kn05JI9B6Gjj4YYbplMr4nGP87mD6ifylEhkjyhuWyKx9h2YN6B49S5BGHSVmBtbnhrUMlXmsbu 0BzZVM9ETlLPESkYrbpLT7Geru2vV1mPCc1KBYGikiwf/gEDVUw7SGsD6MZXbwHsee+VO470mT2BV 9WznKCRA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kI5pz-0004Ge-TZ; Tue, 15 Sep 2020 07:57:16 +0000 Received: from szxga04-in.huawei.com ([45.249.212.190] helo=huawei.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kI5pw-0004GA-5j for linux-arm-kernel@lists.infradead.org; Tue, 15 Sep 2020 07:57:13 +0000 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 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 X-Originating-IP: [10.175.113.25] X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200915_035712_546700_3DA51F5E X-CRM114-Status: GOOD ( 11.86 ) X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [45.249.212.190 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_H4 RBL: Very Good reputation (+4) [45.249.212.190 listed in wl.mailspike.net] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: kernel-janitors@vger.kernel.org, Wei Yongjun , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Hulk Robot Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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; }