Patch "cpufreq: qcom-hw: Fix memory leak in qcom_cpufreq_hw_read_lut()" has been added to the 5.15-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    cpufreq: qcom-hw: Fix memory leak in qcom_cpufreq_hw_read_lut()

to the 5.15-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     cpufreq-qcom-hw-fix-memory-leak-in-qcom_cpufreq_hw_r.patch
and it can be found in the queue-5.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 3f4173c7d8122c63c72f353e40e5b7f5790f1eca
Author: Chen Hui <judy.chenhui@xxxxxxxxxx>
Date:   Tue Nov 8 15:23:02 2022 +0800

    cpufreq: qcom-hw: Fix memory leak in qcom_cpufreq_hw_read_lut()
    
    [ Upstream commit 9901c21bcaf2f01fe5078f750d624f4ddfa8f81b ]
    
    If "cpu_dev" fails to get opp table in qcom_cpufreq_hw_read_lut(),
    the program will return, resulting in "table" resource is not released.
    
    Fixes: 51c843cf77bb ("cpufreq: qcom: Update the bandwidth levels on frequency change")
    Signed-off-by: Chen Hui <judy.chenhui@xxxxxxxxxx>
    Reviewed-by: Sibi Sankar <quic_sibis@xxxxxxxxxxx>
    Signed-off-by: Viresh Kumar <viresh.kumar@xxxxxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/cpufreq/qcom-cpufreq-hw.c b/drivers/cpufreq/qcom-cpufreq-hw.c
index bb2f59fd0de4..bbcba2c38e85 100644
--- a/drivers/cpufreq/qcom-cpufreq-hw.c
+++ b/drivers/cpufreq/qcom-cpufreq-hw.c
@@ -177,6 +177,7 @@ static int qcom_cpufreq_hw_read_lut(struct device *cpu_dev,
 		}
 	} else if (ret != -ENODEV) {
 		dev_err(cpu_dev, "Invalid opp table in device tree\n");
+		kfree(table);
 		return ret;
 	} else {
 		policy->fast_switch_possible = true;



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux