diff options
author | Kent Russell <kent.russell@amd.com> | 2025-01-02 09:21:46 -0500 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2025-01-06 14:44:29 -0500 |
commit | 6c9c97387be1bf4a5881fe1a6cd00acd4322f283 (patch) | |
tree | 97ce4ee360823048edb287a2554c9aee7c75fbd6 /drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | |
parent | 24a1b66752bb646f2905b6d952a712e61155c9ca (diff) | |
download | linux-6c9c97387be1bf4a5881fe1a6cd00acd4322f283.tar.gz linux-6c9c97387be1bf4a5881fe1a6cd00acd4322f283.tar.bz2 linux-6c9c97387be1bf4a5881fe1a6cd00acd4322f283.zip |
drm/amdgpu: Remove unnecessary NULL check
container_of cannot return NULL, so it is unnecessary to check for
NULL after gem_to_amdgpu_bo, which is just a container_of call
Signed-off-by: Kent Russell <kent.russell@amd.com>
Reviewed-by: Felix Kuehling <felix.kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c index 1a5df8b94661..8dba7425501c 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c @@ -87,10 +87,8 @@ static void amdgpu_gem_object_free(struct drm_gem_object *gobj) { struct amdgpu_bo *aobj = gem_to_amdgpu_bo(gobj); - if (aobj) { - amdgpu_hmm_unregister(aobj); - ttm_bo_put(&aobj->tbo); - } + amdgpu_hmm_unregister(aobj); + ttm_bo_put(&aobj->tbo); } int amdgpu_gem_object_create(struct amdgpu_device *adev, unsigned long size, |