Commit 6f9d54fd authored by Oded Gabbay's avatar Oded Gabbay

amdkfd: Fix memory leak of mqds on dqm fini

The mqds array members are not freed when dqm is uninitialized.
Reviewed-by: default avatarBen Goz <Ben.Goz@amd.com>
Signed-off-by: default avatarOded Gabbay <oded.gabbay@amd.com>
parent e048a0b2
...@@ -575,11 +575,15 @@ static int initialize_nocpsch(struct device_queue_manager *dqm) ...@@ -575,11 +575,15 @@ static int initialize_nocpsch(struct device_queue_manager *dqm)
static void uninitialize_nocpsch(struct device_queue_manager *dqm) static void uninitialize_nocpsch(struct device_queue_manager *dqm)
{ {
int i;
BUG_ON(!dqm); BUG_ON(!dqm);
BUG_ON(dqm->queue_count > 0 || dqm->processes_count > 0); BUG_ON(dqm->queue_count > 0 || dqm->processes_count > 0);
kfree(dqm->allocated_queues); kfree(dqm->allocated_queues);
for (i = 0 ; i < KFD_MQD_TYPE_MAX ; i++)
kfree(dqm->mqds[i]);
mutex_destroy(&dqm->lock); mutex_destroy(&dqm->lock);
kfd2kgd->free_mem(dqm->dev->kgd, kfd2kgd->free_mem(dqm->dev->kgd,
(struct kgd_mem *) dqm->pipeline_mem); (struct kgd_mem *) dqm->pipeline_mem);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment