mirror of
https://github.com/torvalds/linux.git
synced 2026-06-02 03:24:19 +02:00
drm/amd/pm: use kmemdup() rather than kmalloc+memcpy
Issue identified with Coccinelle. Signed-off-by: Alex Dewar <alex.dewar90@gmail.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
4d2997ab21
commit
9ddcbf1f4c
|
|
@ -890,14 +890,12 @@ static int init_powerplay_table_information(
|
|||
power_saving_clock_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));
|
||||
if (result)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user