Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/amdgpu: fix ucode out-of-bounds read warning

Clear warning that read ucode[] may out-of-bounds.

Signed-off-by: Tim Huang <Tim.Huang@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Tim Huang and committed by
Alex Deucher
8944acd0 f683f240

+3
+3
drivers/gpu/drm/amd/amdgpu/amdgpu_cgs.c
··· 213 213 struct amdgpu_firmware_info *ucode; 214 214 215 215 id = fw_type_convert(cgs_device, type); 216 + if (id >= AMDGPU_UCODE_ID_MAXIMUM) 217 + return -EINVAL; 218 + 216 219 ucode = &adev->firmware.ucode[id]; 217 220 if (ucode->fw == NULL) 218 221 return -EINVAL;