amdkfd: Fix memory leak of mqds on dqm fini

The mqds array members are not freed when dqm is uninitialized.

Reviewed-by: Ben Goz <Ben.Goz@amd.com>
Signed-off-by: Oded Gabbay <oded.gabbay@amd.com>
This commit is contained in:
Oded Gabbay 2014-11-25 15:16:38 +02:00
parent e048a0b260
commit 6f9d54fd6e
1 changed files with 4 additions and 0 deletions

View File

@ -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);