Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4597793pxj; Wed, 12 May 2021 08:58:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx79e+nd8ZpelYghEgz8AEgaYvmhGOmjtYeWMC82MTSUxJ8Hx6C/jmttrXo5tvCBrNOZcTa X-Received: by 2002:a05:6402:5a:: with SMTP id f26mr44360345edu.306.1620835099252; Wed, 12 May 2021 08:58:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620835099; cv=none; d=google.com; s=arc-20160816; b=Ehtr4eW7UCdxRrLw/xvHSY/ww4fpYpwHW/E/CX8DBCqMZGHMpk+c9n4246M9/R87X0 tovRqnmuXWM0KXPA2LAXpdrME/F0jAP+b8VsH5LtRvDmzkKgE12XzidpNV1ruTViR+a7 XZpk3Z62NTf24m5I2h4ant4sxhjsllCQeDoo8l1B82m9nzk8ST+U5jwAqSW+mL0OE6zE S0Ar/DSv9zqAjcVeo0D7hhsto4A9KfS6wrJ51xYzNmPuJMtaWOYGoYMRQnrlQQNdVj5W myefPze3IBWTU5AIsag/qceFbxuz5luD0Cqta8LtMGk9WzvnWNJ9YD8vtxaLE0IEpm1c 5lXQ== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=mgxNB1q+GFZRzHYbMa4+vGSMz22cYJ4efTbAsK+LbDw=; b=sNl0m6ks9dH7x4+xUPi4AAsSI6u3ZS0lC2olCSWg0cHxN8FBXUWtegx9dKs91gjzxM HKcT2IEAcV9P2uwLIg+HHojkVKvmNIUM6/SsQq9U22c/L/gh3NdCHdYSLyJguchrylS8 uHSG+WRfQ8JFSn+FZ7m/39tdD7P79itCptewpTAOIucqL9CII4hegTEIw8EY78gCKtXT DZLcYs6QP8UMdGmkdGPm5D4Yn4Ix9H1Q059/HvZXVVXYSDM9m9syJkuV1UptCl4HgwV3 cBtzb9zj1jzaAYZgrkXCBWIR64m2b3DPoqJ2L4976mbpUTfucsbj9hhO3umIimbNTaer dnOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wAKJGYYQ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d4si82866edx.488.2021.05.12.08.57.52; Wed, 12 May 2021 08:58:19 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wAKJGYYQ; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237652AbhELP4D (ORCPT + 99 others); Wed, 12 May 2021 11:56:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:40954 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235135AbhELP0z (ORCPT ); Wed, 12 May 2021 11:26:55 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 056A0613FC; Wed, 12 May 2021 15:11:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620832305; bh=kP8zmwsYpphptjHlMFc5rFpOQQ2vW/p1l6FVVnGVhwk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wAKJGYYQupC6jOqX4R1Zbu/o+T852lA0JhEK4pCfqknsyueB7C/WUmIQ4edCumgLx EkXUoiKevLheLhCr4kC1TI3XKZp4Tsx/zvzCkqy2IT6hLtsYVT55tvhZUocPyqqQsq u+7x22ab58C1FR8c9HFqZIr8DMqs+op80a9y7u20= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hulk Robot , Wei Yongjun , Daniel Lezcano , Sasha Levin Subject: [PATCH 5.10 218/530] clocksource/drivers/ingenic_ost: Fix return value check in ingenic_ost_probe() Date: Wed, 12 May 2021 16:45:28 +0200 Message-Id: <20210512144826.999564855@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210512144819.664462530@linuxfoundation.org> References: <20210512144819.664462530@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Wei Yongjun [ Upstream commit 2a65f7e2772613debd03fa2492e76a635aa04545 ] 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 Signed-off-by: Daniel Lezcano Link: https://lore.kernel.org/r/20210308123031.2285083-1-weiyongjun1@huawei.com Signed-off-by: Sasha Levin --- 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"); -- 2.30.2