|
@@ -764,15 +764,12 @@ static int pp_dpm_set_pp_table(void *handle, const char *buf, size_t size)
|
|
|
PP_CHECK_HW(hwmgr);
|
|
|
|
|
|
if (!hwmgr->hardcode_pp_table) {
|
|
|
- hwmgr->hardcode_pp_table =
|
|
|
- kzalloc(hwmgr->soft_pp_table_size, GFP_KERNEL);
|
|
|
+ hwmgr->hardcode_pp_table = kmemdup(hwmgr->soft_pp_table,
|
|
|
+ hwmgr->soft_pp_table_size,
|
|
|
+ GFP_KERNEL);
|
|
|
|
|
|
if (!hwmgr->hardcode_pp_table)
|
|
|
return -ENOMEM;
|
|
|
-
|
|
|
- /* to avoid powerplay crash when hardcode pptable is empty */
|
|
|
- memcpy(hwmgr->hardcode_pp_table, hwmgr->soft_pp_table,
|
|
|
- hwmgr->soft_pp_table_size);
|
|
|
}
|
|
|
|
|
|
memcpy(hwmgr->hardcode_pp_table, buf, size);
|