drm/amd/pm: use DEFINE_DEBUGFS_ATTRIBUTE with debugfs_create_file_unsafe()
Subsystems (3)
PATCH 1/1 drm/amd/pm: use DEFINE_DEBUGFS_ATTRIBUTE with debugfs_create_file_unsafe()
Using DEFINE_DEBUGFS_ATTRIBUTE macro with debugfs_create_file_unsafe() function in place of the debugfs_create_file() function will make the file operation struct "reset" aware of the file's lifetime. Additional details here: https://lists.archive.carbon60.com/linux/kernel/2369498
Issue reported by Coccinelle script:scripts/coccinelle/api/debugfs/debugfs_simple_attr.cocci
Signed-off-by Deepak R Varma <[email protected]>
---
Please Note: This is a Outreachy project task patch.
.../gpu/drm/amd/pm/powerplay/hwmgr/vega12_processpptables.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega12_processpptables.c +2 -3
@@ -252,12 +252,11 @@ static int init_powerplay_table_information(phm_copy_clock_limits_array (hwmgr, &pptable_information->power_saving_clock_max, powerplay_table->PowerSavingClockMax,ATOM_VEGA12_PPCLOCK_COUNT );phm_copy_clock_limits_array (hwmgr, &pptable_information->power_saving_clock_min, powerplay_table->PowerSavingClockMin,ATOM_VEGA12_PPCLOCK_COUNT ); - pptable_information->smc_pptable =kmalloc (sizeof (PPTable_t),GFP_KERNEL ); + pptable_information->smc_pptable =kmemdup (&(powerplay_table->smcPPTable), +sizeof (PPTable_t),GFP_KERNEL );if (pptable_information->smc_pptable ==NULL )return -ENOMEM ; -memcpy (pptable_information->smc_pptable, &(powerplay_table->smcPPTable),sizeof (PPTable_t)); - result =append_vbios_pptable (hwmgr, (pptable_information->smc_pptable));return result;
Signature · 1 line
2.25.1