Commit 9ddcbf1f authored by Alex Dewar's avatar Alex Dewar Committed by Alex Deucher
Browse files

drm/amd/pm: use kmemdup() rather than kmalloc+memcpy



Issue identified with Coccinelle.

Signed-off-by: default avatarAlex Dewar <alex.dewar90@gmail.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 4d2997ab
Loading
Loading
Loading
Loading
+3 −5
Original line number Diff line number Diff line
@@ -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)