Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3527716pxf; Mon, 15 Mar 2021 11:33:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxYvS51gyj33eVFBzCeozy5vPDyKAsUR5G3fouIts8pql1vVaQH7B2knRrF6n4mcZJy3l1c X-Received: by 2002:a17:906:8593:: with SMTP id v19mr25279624ejx.32.1615833181422; Mon, 15 Mar 2021 11:33:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615833181; cv=none; d=google.com; s=arc-20160816; b=DV0P/PTA+ah0Dnibhumdt6/G8vAJJONSF8jYTFf5lkGzkZNtCt9XhjDQCs7/J9VW0b WYTXBFEPBLoaH/NOnelFR+Bi/QxhzfOSgIOlbMhICrWF7snjtbD2VmyzndIDLZwkUD25 4aKDRKGK2PS6AqHEZVDo6FllFOfwhkaaFqhKv/gnf/PpsrER6CSt7fAH9DwcguiXyNpm CT/FL6Xaa5EBhBIvk/K7cDBt61PwggrhlUQST0x6PATgOiNOuaklM7jCSWWrYh5KRdst fkFn4Rg3+E5nIAODhElAor2wfsB5tS2e7a2hLvx/bDTYs/eMeBCIz8NciV0kKeAGJTJG yMzw== 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=0akaHtfHbZ9aI+quyPj/tsA3rk7ESfUzaqwEH98Bpwg=; b=MBUbnnxCiocRZSQBGQiflWc3uB3nvHOo3TcbBM/377I8nY1ruV6fFPl/LpH8GOur/5 mN2gtqDNkC/449skgnrcLT5h1IzOCFsCNqHYnDWA+Q3ez03b/dyShZNKkx7rFOgpWtoL egP2oH/wdhzKX11kn0fVdf7x9Y5blf0XGwNhRhxbHI9CLZceTic5yP7V4J1qA2V4s4Xm Jx3LbBFQ0CTXOKlYI83b3ybmIHEmwyWkF7u6CHTJeLO0rB/57BDaukNp3mKi4LPe5Gp1 YbrEJgOqfvvvb61YkUB4/yyFH2OYUktCAzm95T2dZ4XIzOH1SnqSWkM706T6QiG3LXAL HlOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wg4JExTZ; 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 ss27si11698919ejb.322.2021.03.15.11.32.38; Mon, 15 Mar 2021 11:33:01 -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=wg4JExTZ; 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 S237336AbhCOOnK (ORCPT + 99 others); Mon, 15 Mar 2021 10:43:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:49758 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229494AbhCOOD1 (ORCPT ); Mon, 15 Mar 2021 10:03:27 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6411664E89; Mon, 15 Mar 2021 14:03:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615817005; bh=wIIcVitSW8NYeM9iSd+AC5hGv/p8vMp9aaRKoOswoyU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wg4JExTZ53fWgYefiLmq/Ex/PqigJLKnXJdypAVnUqFclOH2xw21PoNlQFpR/A3iq cBWyvS+RAeyUcmqz5hLG+BOtWfvmVOor5urZoWG6p5ahzO6ZdvvXmT9hflxbWGi7vi wV3eKLS+1Yg7VG5bF8HxrlAR38r9R79NvYnTggTk= From: gregkh@linuxfoundation.org To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hulk Robot , Wei Yongjun , Shawn Guo , Viresh Kumar , Sasha Levin Subject: [PATCH 5.10 243/290] cpufreq: qcom-hw: Fix return value check in qcom_cpufreq_hw_cpu_init() Date: Mon, 15 Mar 2021 14:55:36 +0100 Message-Id: <20210315135550.217702473@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135541.921894249@linuxfoundation.org> References: <20210315135541.921894249@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: Greg Kroah-Hartman From: Wei Yongjun [ Upstream commit 536eb97abeba857126ad055de5923fa592acef25 ] In case of error, the function ioremap() returns NULL pointer not ERR_PTR(). The IS_ERR() test in the return value check should be replaced with NULL test. Fixes: 67fc209b527d ("cpufreq: qcom-hw: drop devm_xxx() calls from init/exit hooks") Reported-by: Hulk Robot Signed-off-by: Wei Yongjun Acked-by: Shawn Guo Signed-off-by: Viresh Kumar Signed-off-by: Sasha Levin --- drivers/cpufreq/qcom-cpufreq-hw.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/cpufreq/qcom-cpufreq-hw.c b/drivers/cpufreq/qcom-cpufreq-hw.c index 5cdd20e38771..6de07556665b 100644 --- a/drivers/cpufreq/qcom-cpufreq-hw.c +++ b/drivers/cpufreq/qcom-cpufreq-hw.c @@ -317,9 +317,9 @@ static int qcom_cpufreq_hw_cpu_init(struct cpufreq_policy *policy) } base = ioremap(res->start, resource_size(res)); - if (IS_ERR(base)) { + if (!base) { dev_err(dev, "failed to map resource %pR\n", res); - ret = PTR_ERR(base); + ret = -ENOMEM; goto release_region; } -- 2.30.1