aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/powerplay/hwmgr/functiontables.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/amd/powerplay/hwmgr/functiontables.c')
-rw-r--r--drivers/gpu/drm/amd/powerplay/hwmgr/functiontables.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/functiontables.c b/drivers/gpu/drm/amd/powerplay/hwmgr/functiontables.c
index 7a705cee0cc2..a6abe81bc843 100644
--- a/drivers/gpu/drm/amd/powerplay/hwmgr/functiontables.c
+++ b/drivers/gpu/drm/amd/powerplay/hwmgr/functiontables.c
@@ -59,8 +59,8 @@ int phm_dispatch_table(struct pp_hwmgr *hwmgr,
59 struct phm_runtime_table_header *rt_table, 59 struct phm_runtime_table_header *rt_table,
60 void *input, void *output) 60 void *input, void *output)
61{ 61{
62 int result = 0; 62 int result;
63 void *temp_storage = NULL; 63 void *temp_storage;
64 64
65 if (hwmgr == NULL || rt_table == NULL) { 65 if (hwmgr == NULL || rt_table == NULL) {
66 printk(KERN_ERR "[ powerplay ] Invalid Parameter!\n"); 66 printk(KERN_ERR "[ powerplay ] Invalid Parameter!\n");
@@ -73,12 +73,13 @@ int phm_dispatch_table(struct pp_hwmgr *hwmgr,
73 printk(KERN_ERR "[ powerplay ] Could not allocate table temporary storage\n"); 73 printk(KERN_ERR "[ powerplay ] Could not allocate table temporary storage\n");
74 return -ENOMEM; 74 return -ENOMEM;
75 } 75 }
76 } else {
77 temp_storage = NULL;
76 } 78 }
77 79
78 result = phm_run_table(hwmgr, rt_table, input, output, temp_storage); 80 result = phm_run_table(hwmgr, rt_table, input, output, temp_storage);
79 81
80 if (NULL != temp_storage) 82 kfree(temp_storage);
81 kfree(temp_storage);
82 83
83 return result; 84 return result;
84} 85}