drm/amdgpu: remove non-sense NULL ptr check
authorChristian König <christian.koenig@amd.com>
Thu, 10 Jan 2019 15:40:42 +0000 (16:40 +0100)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 19 Mar 2019 20:36:58 +0000 (15:36 -0500)
It's a bug having a dead pointer in the IDR, silently returning
is the worst we can do.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c

index 736ed1d67ec2abf303d70c9a0e8f0bbb429723fe..b7289f7096442603a94fed1583095e09974dded4 100644 (file)
@@ -570,12 +570,6 @@ void amdgpu_ctx_mgr_entity_flush(struct amdgpu_ctx_mgr *mgr)
 
        mutex_lock(&mgr->lock);
        idr_for_each_entry(idp, ctx, id) {
-
-               if (!ctx->adev) {
-                       mutex_unlock(&mgr->lock);
-                       return;
-               }
-
                for (i = 0; i < num_entities; i++) {
                        struct drm_sched_entity *entity;
 
@@ -596,10 +590,6 @@ void amdgpu_ctx_mgr_entity_fini(struct amdgpu_ctx_mgr *mgr)
        idp = &mgr->ctx_handles;
 
        idr_for_each_entry(idp, ctx, id) {
-
-               if (!ctx->adev)
-                       return;
-
                if (kref_read(&ctx->refcount) != 1) {
                        DRM_ERROR("ctx %p is still alive\n", ctx);
                        continue;