aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
diff options
context:
space:
mode:
authorKent Russell <[email protected]>2025-01-02 14:21:46 +0000
committerAlex Deucher <[email protected]>2025-01-06 19:44:29 +0000
commit6c9c97387be1bf4a5881fe1a6cd00acd4322f283 (patch)
tree97ce4ee360823048edb287a2554c9aee7c75fbd6 /drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c
parentdrm/amd/pm: Fill max mem bw & total app clk counter (diff)
downloadkernel-6c9c97387be1bf4a5881fe1a6cd00acd4322f283.tar.gz
kernel-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 <[email protected]> Reviewed-by: Felix Kuehling <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c6
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,