From: Oded Gabbay Date: Tue, 25 Nov 2014 13:16:38 +0000 (+0200) Subject: amdkfd: Fix memory leak of mqds on dqm fini X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=6f9d54fd6e0125b17fb286e1e54e934dd11f60d3;p=openwrt%2Fstaging%2Fblogic.git amdkfd: Fix memory leak of mqds on dqm fini The mqds array members are not freed when dqm is uninitialized. Reviewed-by: Ben Goz Signed-off-by: Oded Gabbay --- diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c index 904eb38e3b9f..924e90c072e5 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c @@ -575,11 +575,15 @@ static int initialize_nocpsch(struct device_queue_manager *dqm) static void uninitialize_nocpsch(struct device_queue_manager *dqm) { + int i; + BUG_ON(!dqm); BUG_ON(dqm->queue_count > 0 || dqm->processes_count > 0); kfree(dqm->allocated_queues); + for (i = 0 ; i < KFD_MQD_TYPE_MAX ; i++) + kfree(dqm->mqds[i]); mutex_destroy(&dqm->lock); kfd2kgd->free_mem(dqm->dev->kgd, (struct kgd_mem *) dqm->pipeline_mem);