From: Oded Gabbay Date: Thu, 22 Jan 2015 09:40:06 +0000 (+0200) Subject: drm/amdkfd: Handle case of invalid queue type X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=7113cd652969fe1a59a9560e700000633df6a3e1;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git drm/amdkfd: Handle case of invalid queue type This patch handles a case where amdkfd tries to destroy a queue but the queue type is invalid. This case occurs in non-HWS path. Signed-off-by: Oded Gabbay Reviewed-by: Jammy Zhou --- 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 85387c8b296c..99e2dbbb4862 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c @@ -301,6 +301,11 @@ static int destroy_queue_nocpsch(struct device_queue_manager *dqm, } dqm->sdma_queue_count--; deallocate_sdma_queue(dqm, q->sdma_id); + } else { + pr_debug("q->properties.type is invalid (%d)\n", + q->properties.type); + retval = -EINVAL; + goto out; } retval = mqd->destroy_mqd(mqd, q->mqd,