From patchwork Mon Mar 15 13:55:05 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 400469 Delivered-To: patch@linaro.org Received: by 2002:a02:8562:0:0:0:0:0 with SMTP id g89csp3465483jai; Mon, 15 Mar 2021 07:20:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwHVW1mSbwsOK/Jima+eljpMoN0RF/wPvFyxRMr2UqDF2BAgR42Y+N0I3UMyKP6ILlKB6Xh X-Received: by 2002:a17:906:4d96:: with SMTP id s22mr23857667eju.189.1615817910529; Mon, 15 Mar 2021 07:18:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615817910; cv=none; d=google.com; s=arc-20160816; b=pKW03M+hbZb0YmI9Ng/RTQcniDMvXi3TKRIn8RwdBG10V0XoiP3bNp4zPWRA1mUQjV SHFC5xIpvDYmFyJgNPhUwfERmx4AKdO+4mt2DJmvtQqvbLOejpixLCSOeNMhw47WqVPZ HyR4GFNlh7doo1RUUr8e8l6FEPaagtEfGzkwTbkO2XKZlQI5zRINmwp0WZiQC5Ct84gm VAiv5iJsNENiXNzUtpE/eUc66cI6FZymVk/7xs0QfUOvHJFBXpujxcZpUo1oE9XX7TJb 18RTfJDPabsXCAoytP+xrQBrvRMN0yPhigYNeaNp5q1zR7fxUd+fVkr9sO++wI2XcKe5 HSPg== 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=vGR9JQEJHdmyW1MWRK2xVkVPb5wo0C1M9n5PPRNSV3pfQXv9BZEkLEJ/n2Gmp/u/dQ ZPS+YeC6qNlf9X/3CWf/Nkusb67RkpzE0ebIzR7RQPR2A2WbI43qtl2SodBNGtyfYnnO Ypv72eoxesBJM9sh98dnyda3TuGkUejUHL+mtsTTQyMu+GFLO6W8oLxeqXjMe5IkINs+ kai/yWaxgB3uvTNXEKmowKNwOp3JlnUwCYhLbp4r4g9hp9b2/IOW6a3A6tWcmR12Cdx/ 0ivXPDoCMjHG9YqcIWAAnJ2jQ6r0KMRVLUSjm5Ow6Q6gPyqYlOUo2uaKGSMI6k23SsjU WXng== 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 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.18.30; Mon, 15 Mar 2021 07:18:30 -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=coaY0GtY; 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 S235748AbhCOOKh (ORCPT + 12 others); Mon, 15 Mar 2021 10:10:37 -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 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;