Commit cc3cb791 authored by xinhui pan's avatar xinhui pan Committed by Alex Deucher
Browse files

drm/amdgpu: Fix one list corruption when create queue fails



Queue would be freed when create_queue_cpsch fails
So lets do queue cleanup otherwise various list and memory issues
happen.

Signed-off-by: default avatarxinhui pan <xinhui.pan@amd.com>
Reviewed-by: default avatarPhilip Yang <Philip.Yang@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 9da29026
Loading
Loading
Loading
Loading
+5 −6
Original line number Diff line number Diff line
@@ -1674,15 +1674,14 @@ static int create_queue_cpsch(struct device_queue_manager *dqm, struct queue *q,
	if (q->properties.is_active) {
		increment_queue_count(dqm, qpd, q);

		if (!dqm->dev->shared_resources.enable_mes) {
		if (!dqm->dev->shared_resources.enable_mes)
			retval = execute_queues_cpsch(dqm,
					KFD_UNMAP_QUEUES_FILTER_DYNAMIC_QUEUES, 0);
		} else {
		else
			retval = add_queue_mes(dqm, q, qpd);
		if (retval)
			goto cleanup_queue;
	}
	}

	/*
	 * Unconditionally increment this counter, regardless of the queue's