Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1703200pxb; Mon, 8 Mar 2021 04:27:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJzC8jR0pNTz5UrjBkWzffx/6suenPhFMsMBVOA7mSFxMNUIz0atb/8jLA1SL27zXPSuoWme X-Received: by 2002:a17:906:da0e:: with SMTP id fi14mr15269656ejb.188.1615206456268; Mon, 08 Mar 2021 04:27:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615206456; cv=none; d=google.com; s=arc-20160816; b=zQtrxf+UeOBzZULGQN3H8OI6/WRjYyaoxqL9F3lToYAnQXHhkduOiNE5fXSVi5KgP4 lp+9mibN6b3ga5i9heicGPUa4Wzwo5cIwhXUzb+OvnnYAuxbuJwqPM4VkB+Xp4soA/ie 26GvRiHfdvj2KjvDZztAYhPUg9kPDndH+63vyu3bvG1d2Viowcq3/y6c29+/pGnn0PRt 49kQESiCO4vq+uaxcijSXk0Ataq3/h0+66jyTnBXG+WiweyxJocE6oxij1jrrHnnwCOd dM6ZRc8WuZqrnfPvZ4SogU4tyiaB1vwgFqwPgS9o59BPTP6N+OJWGMWzRhjeS2cT111e bGGg== 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=tHiPy77RJVNyDzfCoGBE6VrP5vafWuOh0kzdqx9wrRg=; b=JY7cymFaWaR+J20mmSDEDy/+SbqN2jCsCZo+oCMpD5yt6qa7iNIGdPNX09M98aWWPf Rt+wPajiUSAq6l/G3ayRGfxfxbvWX+2Tjyv0KLGtq5j1BEHP1Mne2yD1hKytyPEPvJLG QYU2NKcMZY6oXMi4xr8exn3E8frkvH51WuekZTNdmqZe+PqJCns+g8kLFoo9vSYZ9BUW ohDCjdK14FjOldQdlCM32SS5ABjXN3h3K7bH5hxoAietqWvWq7S+hruuJCTsHxq2wWAa htClHGv2LxaKHSrIudKs5pSYOEaesDjWC+xk95j3Ju3C3JkQuhNpEReQ2pvTtDW3nhqD OcIw== 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 f7si7064592edd.179.2021.03.08.04.27.13; Mon, 08 Mar 2021 04:27:36 -0800 (PST) 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 S231935AbhCHMWB (ORCPT + 99 others); Mon, 8 Mar 2021 07:22:01 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:13483 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231971AbhCHMVt (ORCPT ); Mon, 8 Mar 2021 07:21:49 -0500 Received: from DGGEMS407-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4DvHTs5WxVzrSCc; Mon, 8 Mar 2021 20:20:01 +0800 (CST) Received: from localhost.localdomain (10.175.102.38) by DGGEMS407-HUB.china.huawei.com (10.3.19.207) with Microsoft SMTP Server id 14.3.498.0; Mon, 8 Mar 2021 20:21:41 +0800 From: 'Wei Yongjun To: , Daniel Lezcano , Thomas Gleixner , Maarten ter Huurne CC: , , "Hulk Robot" Subject: [PATCH -next] clocksource/drivers/ingenic_ost: Fix return value check in ingenic_ost_probe() Date: Mon, 8 Mar 2021 12:30:31 +0000 Message-ID: <20210308123031.2285083-1-weiyongjun1@huawei.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7BIT X-Originating-IP: [10.175.102.38] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Wei Yongjun In case of error, the function device_node_to_regmap() returns ERR_PTR() and never returns NULL. The NULL test in the return value check should be replaced with IS_ERR(). Fixes: ca7b72b5a5f2 ("clocksource: Add driver for the Ingenic JZ47xx OST") Reported-by: Hulk Robot Signed-off-by: Wei Yongjun --- drivers/clocksource/ingenic-ost.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/clocksource/ingenic-ost.c b/drivers/clocksource/ingenic-ost.c index 029efc2731b4..6af2470136bd 100644 --- a/drivers/clocksource/ingenic-ost.c +++ b/drivers/clocksource/ingenic-ost.c @@ -88,9 +88,9 @@ static int __init ingenic_ost_probe(struct platform_device *pdev) return PTR_ERR(ost->regs); map = device_node_to_regmap(dev->parent->of_node); - if (!map) { + if (IS_ERR(map)) { dev_err(dev, "regmap not found"); - return -EINVAL; + return PTR_ERR(map); } ost->clk = devm_clk_get(dev, "ost");