amdkfd: Fix memory leak of mqds on dqm fini
Subsystems (3)
PATCH 1/1 amdkfd: Fix memory leak of mqds on dqm fini
The mqds array members are not freed when dqm is uninitialized.
Signed-off-by Oded Gabbay <[email protected]>
--- drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +4 -0
@@ -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);
Signature · 6 lines
1.9.1 _______________________________________________ dri-devel mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/dri-devel
Reviewed-by Ben Goz <[email protected]>
-----Original Message-----
From: Gabbay, Oded
Sent: Tuesday, November 25, 2014 3:22 PM
To: [email protected]
Cc: Goz, Ben
Subject: [PATCH] amdkfd: Fix memory leak of mqds on dqm fini
The mqds array members are not freed when dqm is uninitialized.
Signed-off-by Oded Gabbay <[email protected]>
--- drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +4 -1
@@ -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); --
1.9.1
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel