Skip to content

Commit 0be7ed8

Browse files
Luben Tuikovalexdeucher
authored andcommitted
drm/amdgpu: Fix potential NULL dereference
Fix potential NULL dereference, in the case when "man", the resource manager might be NULL, when/if we print debug information. Cc: Alex Deucher <[email protected]> Cc: Christian König <[email protected]> Cc: AMD Graphics <[email protected]> Cc: Dan Carpenter <[email protected]> Cc: kernel test robot <[email protected]> Fixes: 7554886 ("drm/amdgpu: Fix size validation for non-exclusive domains (v4)") Signed-off-by: Luben Tuikov <[email protected]> Reviewed-by: Christian König <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 318ca20 commit 0be7ed8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -470,8 +470,9 @@ static bool amdgpu_bo_validate_size(struct amdgpu_device *adev,
470470
return true;
471471

472472
fail:
473-
DRM_DEBUG("BO size %lu > total memory in domain: %llu\n", size,
474-
man->size);
473+
if (man)
474+
DRM_DEBUG("BO size %lu > total memory in domain: %llu\n", size,
475+
man->size);
475476
return false;
476477
}
477478

0 commit comments

Comments
 (0)