Commit de2a02cc authored by Benjamin Cheng's avatar Benjamin Cheng Committed by Alex Deucher
Browse files

drm/amdgpu/vce: Prevent partial address patches



In the case that only one of lo/hi is valid, the patching could result
in a bad address written to in FW.

Signed-off-by: default avatarBenjamin Cheng <benjamin.cheng@amd.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
parent 66085e20
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -680,6 +680,9 @@ static int amdgpu_vce_cs_reloc(struct amdgpu_cs_parser *p, struct amdgpu_ib *ib,
	uint64_t addr;
	int r;

	if (lo >= ib->length_dw || hi >= ib->length_dw)
		return -EINVAL;

	if (index == 0xffffffff)
		index = 0;