Skip to content

Commit 036f18d

Browse files
Tao Zhoualexdeucher
authored andcommitted
drm/amdgpu: check save count before RAS bad page saving
It's possible that unit_num is larger than 0 but save_count is zero, since we do get bad page address but the address is invalid. Check unit_num and save_count together. Signed-off-by: Tao Zhou <tao.zhou1@amd.com> Reviewed-by: Candice Li <candice.li@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent d5a62b7 commit 036f18d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3142,7 +3142,7 @@ int amdgpu_ras_save_bad_pages(struct amdgpu_device *adev,
31423142
*new_cnt = unit_num;
31433143

31443144
/* only new entries are saved */
3145-
if (unit_num > 0) {
3145+
if (unit_num && save_count) {
31463146
/*old asics only save pa to eeprom like before*/
31473147
if (IP_VERSION_MAJ(amdgpu_ip_version(adev, UMC_HWIP, 0)) < 12) {
31483148
if (amdgpu_ras_eeprom_append(control,

0 commit comments

Comments
 (0)