Patch "drm/amd/pm: fix a potential gpu_metrics_table memory leak" has been added to the 5.10-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

    drm/amd/pm: fix a potential gpu_metrics_table memory leak

to the 5.10-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:
     drm-amd-pm-fix-a-potential-gpu_metrics_table-memory-.patch
and it can be found in the queue-5.10 subdirectory.

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



commit 97087926209b87c5cbbeceadd5cdbce4413d0d84
Author: Lang Yu <lang.yu@xxxxxxx>
Date:   Tue Dec 14 15:25:54 2021 +0800

    drm/amd/pm: fix a potential gpu_metrics_table memory leak
    
    [ Upstream commit aa464957f7e660abd554f2546a588f6533720e21 ]
    
    Memory is allocated for gpu_metrics_table in renoir_init_smc_tables(),
    but not freed in int smu_v12_0_fini_smc_tables(). Free it!
    
    Fixes: 95868b85764a ("drm/amd/powerplay: add Renoir support for gpu metrics export")
    
    Signed-off-by: Lang Yu <lang.yu@xxxxxxx>
    Reviewed-by: Lijo Lazar <lijo.lazar@xxxxxxx>
    Signed-off-by: Alex Deucher <alexander.deucher@xxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/gpu/drm/amd/pm/swsmu/smu12/smu_v12_0.c b/drivers/gpu/drm/amd/pm/swsmu/smu12/smu_v12_0.c
index 7907c9e0b5dec..b938fd12da4d5 100644
--- a/drivers/gpu/drm/amd/pm/swsmu/smu12/smu_v12_0.c
+++ b/drivers/gpu/drm/amd/pm/swsmu/smu12/smu_v12_0.c
@@ -187,6 +187,9 @@ int smu_v12_0_fini_smc_tables(struct smu_context *smu)
 	kfree(smu_table->watermarks_table);
 	smu_table->watermarks_table = NULL;
 
+	kfree(smu_table->gpu_metrics_table);
+	smu_table->gpu_metrics_table = NULL;
+
 	return 0;
 }
 



[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