mirror of
https://github.com/torvalds/linux.git
synced 2026-12-05 21:04:14 +00:00
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: Benjamin Cheng <[email protected]> Reviewed-by: Alex Deucher <[email protected]> Signed-off-by: Alex Deucher <[email protected]> Cc: [email protected]
This commit is contained in:
committed by
Alex Deucher
parent
66085e2064
commit
de2a02cc28
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user