From patchwork Mon Mar 15 13:55:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 400478 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp3470265jai; Mon, 15 Mar 2021 07:25:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwgSe/jrNYreW0XHizBHHGzLOAjXyZywlB0tfem2NBNYeL2LlJGcHpr8+horsf3ug2rc2Mg X-Received: by 2002:aa7:d416:: with SMTP id z22mr29972201edq.239.1615818359632; Mon, 15 Mar 2021 07:25:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615818359; cv=none; d=google.com; s=arc-20160816; b=UKGY0KXvtpubIMb7wlmaslMNM6+LOZOy84Oz5/SnGv8UOqaIMRCk4NvVsIBKxNA+0V YTMigGReD/bqG4VG1NDW6RfsF0178Y/vfanR4LcMXaQaf1/q6oRM0DdACfprFw7inVMK 61PIGZ5AeCR+XGtIfvyd593yQrKSuIbgqZaGTIgCS15C0vSGVhH9XoSHaoxOQwDJIst7 s2br9WZ4Pmx10BnBzYwrdqJai8escFko6rBm1kfMKU7XRQWnMPoUQSQeV04xFLVsw4Pf k+ZPE0kPN6QNlyWABY+De5Fiq49UW1XBVIeW5CZk2TT72MQ7b8OBVKzRfEtdUzWzRxfg bEIQ== 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=Km4xa0QD5liwUIxhOePwzUdA7AHv+jeIyjPuWFes/rzkEFXijzV7eTwNlBflviVrtC Jj5dCOVjerAYySKzc6SaEH308FAF+QMSylWllB9sYxdCxUTszcQZrKgw5+qyAReKtoBj UDsvBx/u2O3TeaZoGgPDsZ8Uv5w2ojTjUfqIOF0VWaF41x1zzn7NoKaz/1eZoS9fblIN WYIkowcjOYCYsUShPfrD6hLf/RBLRr2u6qyiBnyXJgjb2YcKKtFTvvN9p4G5e51ZPBAL noPRsve/3nwygtA1UBdrVsWSCkykwdFJQ2OTQGiMQ1wKlrB11TjK2tPOCFFgGwwFl4hR fc2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=miNxdrdQ; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-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 h21si993553ede.37.2021.03.15.07.25.59; Mon, 15 Mar 2021 07:25:59 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-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=miNxdrdQ; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-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 S235477AbhCOOJA (ORCPT + 12 others); Mon, 15 Mar 2021 10:09:00 -0400 Received: from mail.kernel.org ([198.145.29.99]:49718 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234466AbhCOODY (ORCPT ); Mon, 15 Mar 2021 10:03:24 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5646764EEF; Mon, 15 Mar 2021 14:03:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615817004; bh=53IlfbVNqOlyDdD4cFDUvx5We7nCRPWzMldJuRJZDQ8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=miNxdrdQpySSLWLHhuMyUl0l/9w4jypCK3zYUPWBV8Ki5C7QXLUaEtLHnO9NONsO9 l8C3cAGxjqooG9hJy/GXy4WI2n0CqkH5DxVclzhKM3ZdZV35eo5bFzZpwm1MkgHucf sdsXrWXVSI5d1lTWLv+ycKVWYVYpAYzN3u7Bs+NU= 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.10 242/290] cpufreq: qcom-hw: fix dereferencing freed memory data Date: Mon, 15 Mar 2021 14:55:35 +0100 Message-Id: <20210315135550.188289628@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 Precedence: bulk List-ID: X-Mailing-List: stable@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(-) -- 2.30.1 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;