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

drm/amdgpu: remove non-sense NULL ptr check

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>

authored by

Christian König and committed by
Alex Deucher
3119e7f4 04ed8459

-10
-10
drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
··· 570 570 571 571 mutex_lock(&mgr->lock); 572 572 idr_for_each_entry(idp, ctx, id) { 573 - 574 - if (!ctx->adev) { 575 - mutex_unlock(&mgr->lock); 576 - return; 577 - } 578 - 579 573 for (i = 0; i < num_entities; i++) { 580 574 struct drm_sched_entity *entity; 581 575 ··· 590 596 idp = &mgr->ctx_handles; 591 597 592 598 idr_for_each_entry(idp, ctx, id) { 593 - 594 - if (!ctx->adev) 595 - return; 596 - 597 599 if (kref_read(&ctx->refcount) != 1) { 598 600 DRM_ERROR("ctx %p is still alive\n", ctx); 599 601 continue;