From: jsg Date: Thu, 19 Jan 2023 00:32:55 +0000 (+0000) Subject: drm/amdgpu: Fix potential NULL dereference X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=6ea665e5ae560043f27349b8fc11a10158f466c6;p=openbsd drm/amdgpu: Fix potential NULL dereference From Luben Tuikov f2faf0699af78968a27ca154bf76e94247f8c471 in linux-6.1.y/6.1.7 0be7ed8e7eb15282b5d0f6fdfea884db594ea9bf in mainline linux --- diff --git a/sys/dev/pci/drm/amd/amdgpu/amdgpu_object.c b/sys/dev/pci/drm/amd/amdgpu/amdgpu_object.c index 80e4beabb33..edc3cbd3764 100644 --- a/sys/dev/pci/drm/amd/amdgpu/amdgpu_object.c +++ b/sys/dev/pci/drm/amd/amdgpu/amdgpu_object.c @@ -469,8 +469,9 @@ static bool amdgpu_bo_validate_size(struct amdgpu_device *adev, return true; fail: - DRM_DEBUG("BO size %lu > total memory in domain: %llu\n", size, - man->size); + if (man) + DRM_DEBUG("BO size %lu > total memory in domain: %llu\n", size, + man->size); return false; }