Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3527395pxf; Mon, 15 Mar 2021 11:32:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyHJ/Nl35gZLJxcPbJe3N1GJ1aP/RElEAzPEPuFZyBFdLXmtBRZ9ljCUYrWs0GYaStVkxtk X-Received: by 2002:a50:ee10:: with SMTP id g16mr31054787eds.215.1615833157815; Mon, 15 Mar 2021 11:32:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615833157; cv=none; d=google.com; s=arc-20160816; b=bvDhRCmK/RTrF6D25y/B+ZbIVV4ZmWVtGWOqbjmJBkRbfDy8lgIiZ3hTqRnyNFtdlw LZolsWW1JbvtnGl5FAqRB8baUrX16DdeYny89xqT/YHvd7lt4Vga5yKzpcSBcilKSxno MsVUJc1Js3fkMzJsBc0IcyQU88vJdo+PQlkDuEJHeLIiH3XHVWfJ7dcewfC4/mcgl1jx N5IHR0JhwYmzC2MqenVq0JbDoks7YVa6Sh824VSXkSYapF7NuSVvVLKBDybMnsK+QB7O 3zDSNQ1cbyvJ6wa081yPbMpqvlgHCPCjvpGqdk7i3QLa7yNYmRMumMJ+u/NrrlEg5plB 26ow== 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=kgcvN04y0P6hjUAqJGblTiEerTddetUOmp4bvGl9Uoer0pcIbbiZ8rDRo5d+e1T3Ih cc5tT7ehahy/SOVNy9omIZEPsg48+0L1O+IG2kU9wRj7CKL6u7z0wy7daOCWr0P7vgIp QjrdM68Rygw+2KPh8QNxGL3waOLDlbupfoqFyf0OfY5uMtZqxPeo4QiFIBySrByxGlnz iiGHqcfSgciqcvMpao4x4/O9fVNnWXDIw3iPOBdHRdUKj30piPULD+uO06CDsvVgUlHP VuCSzUBHsjtfp5MOSAivyZfyNtY/yKXeriRPqNjV4Z1b0mDHJaptddgrZwaduyJcNHoi dmfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=oSkv+1YU; 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 a4si11747809ejy.263.2021.03.15.11.32.15; Mon, 15 Mar 2021 11:32:37 -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=oSkv+1YU; 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 S238219AbhCOOm1 (ORCPT + 99 others); Mon, 15 Mar 2021 10:42:27 -0400 Received: from mail.kernel.org ([198.145.29.99]:49464 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234197AbhCOODD (ORCPT ); Mon, 15 Mar 2021 10:03:03 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0D45064EEF; Mon, 15 Mar 2021 14:03:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816982; bh=wIIcVitSW8NYeM9iSd+AC5hGv/p8vMp9aaRKoOswoyU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oSkv+1YUySNYwfj/bPsvgmuMWCUxfyZKM+epfXm+SR0SJic5h3SzF1882BEJHCwmI hrotIWqxebojL1tGKZJA7bsQb3WhZNMmSzhwbce4T6Y6zHMyIMI5ArRtNcq18SUNUB 6rwqfo4ZErK7WgcrKzBxjhwEYtV389MuvUUBTAlI= 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.11 243/306] cpufreq: qcom-hw: Fix return value check in qcom_cpufreq_hw_cpu_init() Date: Mon, 15 Mar 2021 14:55:06 +0100 Message-Id: <20210315135515.856496762@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135507.611436477@linuxfoundation.org> References: <20210315135507.611436477@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