Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3355823pxf; Mon, 15 Mar 2021 07:52:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw3b4ap6IswUhUg4xYqg18Llxp7gFzfDyfhp0ULt8SObtdS1nzRJEMvt/T3sZ5oDvexAQ1E X-Received: by 2002:a17:906:3f88:: with SMTP id b8mr13597668ejj.36.1615819817453; Mon, 15 Mar 2021 07:50:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615819817; cv=none; d=google.com; s=arc-20160816; b=m58kf3n9DIac6iomthuMWXP+BX6k/VFAHFVXdqV1zVSrbmx1bGrtM74SBpbr8Ryeaa hrl1cjx8PlR7yjL0SOnWVTcS3frb6S6zvJsW3/87X7MM/HJBWFrpNS5fUYsV9YuuMrcs no67k8vGjGwjgZGQDSloRpFOAbmkAV+9v83fQ9wnvY/NxuvYY0A6+clER7XoPpxyukqc 3emhSzS5NJlxaQQnK2hCPtEvU54+B+mp7MZowJBlnMsPenZrGoSeLaH2rvRCUYp2jMl+ NfaTINNCmj3x/H7bQeWOyVGqf7HxJDroL3kqVeUdnH1n63YPuF7JzFkqjJixVY0aH9UA zGpw== 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=LSZ0nCL5AE3Y85RQVpeACYE26DDHK6iofZWgOQc4mTU=; b=ZiBJdNiSUPBLCCJ85oTvPLW9ZkteWST4KjkE9+YRGZwOkm3GfkJMqWgdPp3jbgDq8D iguu7q8eVp1iwMeX4wHx372VVIi/+7AP+ljg1f3a9y9MdP32rZbtOlTgOIjIGPg+F0Qb mxS9TJynzAvBdXwgwc0JfuGMrUXp0x1xurDXaijWCmLxfwgJVr4vAM7phLHugXRIG2+6 8B9X8ypv8VwPRwy4V4BlY4BUIcuM3STw4p2lv6hzw/wDxgX4WUMrmlQiJ//CM1nfbtBN fcaaShcLVTI8yfnZwVQqKveCWc+oOlWotqc3GKIKRPm+F+6MN4IzRW9bVhcGTbtBV79C acJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=coaY0GtY; 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 s5si10965492ejx.287.2021.03.15.07.49.53; Mon, 15 Mar 2021 07:50:17 -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=coaY0GtY; 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 S240885AbhCOOsL (ORCPT + 99 others); Mon, 15 Mar 2021 10:48:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:49446 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234157AbhCOODA (ORCPT ); Mon, 15 Mar 2021 10:03:00 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id DCD0B64DAD; Mon, 15 Mar 2021 14:02:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816980; bh=53IlfbVNqOlyDdD4cFDUvx5We7nCRPWzMldJuRJZDQ8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=coaY0GtYrwzsDJXJzIMBMbR2tC1mXCYTsnj1/TTpwzRnpdw3rSAUR43emPQUkNWk3 Ew85YJKD9y3lJhFCCx7Nxm7lqiH1YS3ThHpywvwGVqRV/Nfw9Sd7uZiuJqh5aB9REV zDc0x8OFLxXtNmhtuUJMB7lNLzOrt61+XbUx09rk= From: gregkh@linuxfoundation.org To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, kernel test robot , Dan Carpenter , Shawn Guo , Viresh Kumar , Sasha Levin Subject: [PATCH 5.11 242/306] cpufreq: qcom-hw: fix dereferencing freed memory data Date: Mon, 15 Mar 2021 14:55:05 +0100 Message-Id: <20210315135515.824595904@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: Shawn Guo [ Upstream commit 02fc409540303801994d076fcdb7064bd634dbf3 ] Commit 67fc209b527d ("cpufreq: qcom-hw: drop devm_xxx() calls from init/exit hooks") introduces an issue of dereferencing freed memory 'data'. Fix it. Fixes: 67fc209b527d ("cpufreq: qcom-hw: drop devm_xxx() calls from init/exit hooks") Reported-by: kernel test robot Reported-by: Dan Carpenter Signed-off-by: Shawn Guo Signed-off-by: Viresh Kumar Signed-off-by: Sasha Levin --- drivers/cpufreq/qcom-cpufreq-hw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/cpufreq/qcom-cpufreq-hw.c b/drivers/cpufreq/qcom-cpufreq-hw.c index 2726e77c9e5a..5cdd20e38771 100644 --- a/drivers/cpufreq/qcom-cpufreq-hw.c +++ b/drivers/cpufreq/qcom-cpufreq-hw.c @@ -368,7 +368,7 @@ static int qcom_cpufreq_hw_cpu_init(struct cpufreq_policy *policy) error: kfree(data); unmap_base: - iounmap(data->base); + iounmap(base); release_region: release_mem_region(res->start, resource_size(res)); return ret; -- 2.30.1