From: Pixel Ding Date: Wed, 18 Apr 2018 08:33:26 +0000 (-0400) Subject: drm/scheduler: always put last_sched fence in entity_fini X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=a4b3996aeebbaafd2682f4db06bb5659e1653da7;p=openwrt%2Fstaging%2Fblogic.git drm/scheduler: always put last_sched fence in entity_fini Fix the potential memleak since scheduler main thread always hold one last_sched fence. Signed-off-by: Pixel Ding Reviewed-by: Christian König Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/scheduler/gpu_scheduler.c b/drivers/gpu/drm/scheduler/gpu_scheduler.c index 44d21981bf3b..4968867da7a6 100644 --- a/drivers/gpu/drm/scheduler/gpu_scheduler.c +++ b/drivers/gpu/drm/scheduler/gpu_scheduler.c @@ -276,10 +276,10 @@ void drm_sched_entity_cleanup(struct drm_gpu_scheduler *sched, else if (r) DRM_ERROR("fence add callback failed (%d)\n", r); } - - dma_fence_put(entity->last_scheduled); - entity->last_scheduled = NULL; } + + dma_fence_put(entity->last_scheduled); + entity->last_scheduled = NULL; } EXPORT_SYMBOL(drm_sched_entity_cleanup);