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

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 <Alexander.Deucher@amd.com>
Cc: Christian König <christian.koenig@amd.com>
Cc: AMD Graphics <amd-gfx@lists.freedesktop.org>
Cc: Dan Carpenter <error27@gmail.com>
Cc: kernel test robot <lkp@intel.com>
Fixes: 7554886daa31ea ("drm/amdgpu: Fix size validation for non-exclusive domains (v4)")
Signed-off-by: Luben Tuikov <luben.tuikov@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Luben Tuikov and committed by
Alex Deucher
0be7ed8e 318ca208

+3 -2
+3 -2
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c
··· 470 470 return true; 471 471 472 472 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); 475 476 return false; 476 477 } 477 478