Unverified Commit 0e2961dc authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!4777 drivers/amd/pm: fix a use-after-free in kv_parse_power_table

parents 8247b7f0 b1bfbccc
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -2746,10 +2746,8 @@ static int kv_parse_power_table(struct amdgpu_device *adev)
		non_clock_info = (struct _ATOM_PPLIB_NONCLOCK_INFO *)
			&non_clock_info_array->nonClockInfo[non_clock_array_index];
		ps = kzalloc(sizeof(struct kv_ps), GFP_KERNEL);
		if (ps == NULL) {
			kfree(adev->pm.dpm.ps);
		if (ps == NULL)
			return -ENOMEM;
		}
		adev->pm.dpm.ps[i].ps_priv = ps;
		k = 0;
		idx = (u8 *)&power_state->v2.clockInfoIndex[0];